diff options
author | micael.bergeron <micaelbergeron@gmail.com> | 2017-11-22 09:48:09 -0500 |
---|---|---|
committer | micael.bergeron <micaelbergeron@gmail.com> | 2017-12-07 09:01:37 -0500 |
commit | cb6f51ec9b2006f1040cca94119135c92e9a4cd1 (patch) | |
tree | 6331c54f8eab568e134c51ec85a0232372471a16 /app/controllers | |
parent | 716f9cbb415cd425644b1aeae19844b26cc7d6b7 (diff) | |
download | gitlab-ce-cb6f51ec9b2006f1040cca94119135c92e9a4cd1.tar.gz |
add support for the commit reference filter
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/concerns/renders_notes.rb | 11 | ||||
-rw-r--r-- | app/controllers/projects/merge_requests/diffs_controller.rb | 5 |
2 files changed, 3 insertions, 13 deletions
diff --git a/app/controllers/concerns/renders_notes.rb b/app/controllers/concerns/renders_notes.rb index a35313c917c..824ad06465c 100644 --- a/app/controllers/concerns/renders_notes.rb +++ b/app/controllers/concerns/renders_notes.rb @@ -3,7 +3,7 @@ module RendersNotes preload_noteable_for_regular_notes(notes) preload_max_access_for_authors(notes, @project) preload_first_time_contribution_for_authors(noteable, notes) - Notes::RenderService.new(current_user).execute(notes, @project, noteable_context(noteable)) + Notes::RenderService.new(current_user).execute(notes, @project) notes end @@ -26,13 +26,4 @@ module RendersNotes notes.each {|n| n.specialize_for_first_contribution!(noteable)} end - - def noteable_context(noteable) - case noteable - when MergeRequest - { merge_request: noteable } - else - {} - end - end end diff --git a/app/controllers/projects/merge_requests/diffs_controller.rb b/app/controllers/projects/merge_requests/diffs_controller.rb index 07bf9db5a34..fe8525a488c 100644 --- a/app/controllers/projects/merge_requests/diffs_controller.rb +++ b/app/controllers/projects/merge_requests/diffs_controller.rb @@ -21,8 +21,7 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic private def define_diff_vars - @merge_request_diffs = @merge_request.merge_request_diffs.viewable.select_without_diff.order_id_desc - + @merge_request_diffs = @merge_request.merge_request_diffs.viewable.order_id_desc @compare = commit || find_merge_request_diff_compare return render_404 unless @compare @@ -31,7 +30,7 @@ class Projects::MergeRequests::DiffsController < Projects::MergeRequests::Applic def commit return nil unless commit_id = params[:commit_id].presence - return nil unless @merge_request.all_commit_shas.include?(commit_id) + return nil unless @merge_request.all_commits.exists?(sha: commit_id) @commit ||= @project.commit(commit_id) end |