Commit 38f930b9 authored by Terri Chu's avatar Terri Chu Committed by Steve Abrams

Use default project filter for issue/merge request project searches

Changelog: performance
parent e524d530
...@@ -8,7 +8,8 @@ module Gitlab ...@@ -8,7 +8,8 @@ module Gitlab
@project = project @project = project
@repository_ref = repository_ref.presence @repository_ref = repository_ref.presence
super(current_user, query, [project], order_by: order_by, sort: sort, filters: filters) # use the default filter for project searches since we are already limiting by a single project
super(current_user, query, [project], order_by: order_by, sort: sort, filters: filters, default_project_filter: true)
end end
def objects(scope, page: nil, per_page: DEFAULT_PER_PAGE, preload_method: nil) def objects(scope, page: nil, per_page: DEFAULT_PER_PAGE, preload_method: nil)
......
...@@ -168,7 +168,7 @@ module Gitlab ...@@ -168,7 +168,7 @@ module Gitlab
issues = IssuesFinder.new(current_user, issuable_params.merge(finder_params)).execute issues = IssuesFinder.new(current_user, issuable_params.merge(finder_params)).execute
unless default_project_filter unless default_project_filter
issues = issues.where(project_id: project_ids_relation) # rubocop: disable CodeReuse/ActiveRecord issues = issues.in_projects(project_ids_relation)
end end
apply_sort(issues, scope: 'issues') apply_sort(issues, scope: 'issues')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment