d2f1d585e1
When searching for merge requests, an additional subquery is added which by default filters only merge requests which belong to source or target project user has permission for. This filter is not needed because more restrictive filter which checks if user has permission for target project is used in the query. So unless a custom projects filter is used by user, it's possible to skip the default projects filter and speed up the final query. Related to #40540
19 lines
393 B
Ruby
19 lines
393 B
Ruby
module Search
|
|
class GroupService < Search::GlobalService
|
|
attr_accessor :group
|
|
|
|
def initialize(user, group, params)
|
|
super(user, params)
|
|
|
|
@default_project_filter = false
|
|
@group = group
|
|
end
|
|
|
|
def projects
|
|
return Project.none unless group
|
|
return @projects if defined? @projects
|
|
|
|
@projects = super.inside_path(group.full_path)
|
|
end
|
|
end
|
|
end
|