diff options
Diffstat (limited to 'app/finders/merge_requests_finder.rb')
-rw-r--r-- | app/finders/merge_requests_finder.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/finders/merge_requests_finder.rb b/app/finders/merge_requests_finder.rb index 95b5b267089..b7de1c08f86 100644 --- a/app/finders/merge_requests_finder.rb +++ b/app/finders/merge_requests_finder.rb @@ -46,6 +46,7 @@ class MergeRequestsFinder < IssuableFinder :merged_before, :reviewer_id, :reviewer_username, + :source_branch, :target_branch, :wip ] @@ -73,7 +74,6 @@ class MergeRequestsFinder < IssuableFinder items = by_deployments(items) items = by_reviewer(items) items = by_source_project_id(items) - items = items.allow_cross_joins_across_databases(url: "https://gitlab.com/gitlab-org/gitlab/-/issues/417462") by_approved(items) end @@ -82,7 +82,8 @@ class MergeRequestsFinder < IssuableFinder items = super(items) items = by_negated_reviewer(items) items = by_negated_approved_by(items) - by_negated_target_branch(items) + items = by_negated_target_branch(items) + by_negated_source_branch(items) end private @@ -133,6 +134,12 @@ class MergeRequestsFinder < IssuableFinder items.where.not(target_branch: not_params[:target_branch]) end + + def by_negated_source_branch(items) + return items unless not_params[:source_branch] + + items.where.not(source_branch: not_params[:source_branch]) + end # rubocop: enable CodeReuse/ActiveRecord def by_negated_approved_by(items) |