Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2018-02-20 15:33:49 +0300
committerSean McGivern <sean@gitlab.com>2018-02-21 13:31:29 +0300
commitc2fc40668c34215a7e727e60647114f1b178eb8c (patch)
tree75736437f7657fa617dd3a48376b73bd46e0c9fc /app/controllers/projects/merge_requests_controller.rb
parent5048c8d5050cd432381d845997c5e7991e6590f1 (diff)
Refactor IssuableFinder to extract model-specific logic
By extracting a new `filter_items` method, we can override that in the IssuesFinder and MergeRequestsFinder separately, so we don't need checks that the model is the correct one, because we can just use the class we're in to know that. We can do the same for the VALID_PARAMS constant, by making it a class method.
Diffstat (limited to 'app/controllers/projects/merge_requests_controller.rb')
-rw-r--r--app/controllers/projects/merge_requests_controller.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 8eed957d9fe..a1af125547c 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -323,9 +323,8 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
@target_branches = @merge_request.target_project.repository.branch_names
end
- def set_issuables_index
- @finder_type = MergeRequestsFinder
- super
+ def finder_type
+ MergeRequestsFinder
end
def check_user_can_push_to_source_branch!