debian-mirror-gitlab/app/services/search/group_service.rb

28 lines
598 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2017-08-17 22:00:37 +05:30
module Search
class GroupService < Search::GlobalService
attr_accessor :group
def initialize(user, group, params)
super(user, params)
2018-03-17 18:26:18 +05:30
@default_project_filter = false
2017-08-17 22:00:37 +05:30
@group = group
end
2019-05-18 00:54:41 +05:30
def execute
Gitlab::GroupSearchResults.new(
current_user, projects, group, params[:search], default_project_filter: default_project_filter
)
end
2017-08-17 22:00:37 +05:30
def projects
return Project.none unless group
return @projects if defined? @projects
@projects = super.inside_path(group.full_path)
end
end
end