diff options
author | Sean McGivern <sean@gitlab.com> | 2018-02-20 15:33:49 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-02-21 13:31:29 +0300 |
commit | c2fc40668c34215a7e727e60647114f1b178eb8c (patch) | |
tree | 75736437f7657fa617dd3a48376b73bd46e0c9fc /app/controllers/projects/merge_requests_controller.rb | |
parent | 5048c8d5050cd432381d845997c5e7991e6590f1 (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.rb | 5 |
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! |