c2fc40668c
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.
23 lines
569 B
Ruby
23 lines
569 B
Ruby
module MergeRequestsAction
|
|
extend ActiveSupport::Concern
|
|
include IssuableCollections
|
|
|
|
# rubocop:disable Gitlab/ModuleWithInstanceVariables
|
|
def merge_requests
|
|
@merge_requests = issuables_collection.page(params[:page])
|
|
|
|
@issuable_meta_data = issuable_meta_data(@merge_requests, collection_type)
|
|
end
|
|
# rubocop:enable Gitlab/ModuleWithInstanceVariables
|
|
|
|
private
|
|
|
|
def finder_type
|
|
(super if defined?(super)) ||
|
|
(MergeRequestsFinder if action_name == 'merge_requests')
|
|
end
|
|
|
|
def filter_params
|
|
super.merge(non_archived: true)
|
|
end
|
|
end
|