diff options
Diffstat (limited to 'app/finders/merge_requests_finder.rb')
-rw-r--r-- | app/finders/merge_requests_finder.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/app/finders/merge_requests_finder.rb b/app/finders/merge_requests_finder.rb index ffa912afd1e..0ce2d52f168 100644 --- a/app/finders/merge_requests_finder.rb +++ b/app/finders/merge_requests_finder.rb @@ -36,6 +36,7 @@ class MergeRequestsFinder < IssuableFinder def self.scalar_params @scalar_params ||= super + [ + :approved, :approved_by_ids, :deployed_after, :deployed_before, @@ -71,8 +72,9 @@ class MergeRequestsFinder < IssuableFinder items = by_approvals(items) items = by_deployments(items) items = by_reviewer(items) + items = by_source_project_id(items) - by_source_project_id(items) + by_approved(items) end def filter_negated_items(items) @@ -183,6 +185,17 @@ class MergeRequestsFinder < IssuableFinder end # rubocop: enable CodeReuse/Finder + def by_approved(items) + approved_param = Gitlab::Utils.to_boolean(params.fetch(:approved, nil)) + return items if approved_param.nil? + + if approved_param + items.with_approvals + else + items.without_approvals + end + end + def by_deployments(items) env = params[:environment] before = parse_datetime(params[:deployed_before]) |