Class: Search::GroupService

Inherits:
GlobalService show all
Defined in:
app/services/search/group_service.rb

Constant Summary

Constants inherited from GlobalService

Search::GlobalService::ALLOWED_SCOPES, Search::GlobalService::DEFAULT_SCOPE

Instance Attribute Summary collapse

Attributes inherited from GlobalService

#current_user, #params

Instance Method Summary collapse

Methods inherited from GlobalService

#allowed_scopes, #scope

Constructor Details

#initialize(user, group, params) ⇒ GroupService

Returns a new instance of GroupService.



7
8
9
10
11
# File 'app/services/search/group_service.rb', line 7

def initialize(user, group, params)
  super(user, params)

  @group = group
end

Instance Attribute Details

#groupObject

Returns the value of attribute group.



5
6
7
# File 'app/services/search/group_service.rb', line 5

def group
  @group
end

Instance Method Details

#executeObject



13
14
15
16
17
18
19
20
21
22
23
# File 'app/services/search/group_service.rb', line 13

def execute
  Gitlab::GroupSearchResults.new(
    current_user,
    params[:search],
    projects,
    group: group,
    order_by: params[:order_by],
    sort: params[:sort],
    filters: filters
  )
end

#projectsObject



25
26
27
28
29
30
# File 'app/services/search/group_service.rb', line 25

def projects
  return Project.none unless group
  return @projects if defined? @projects

  @projects = super.inside_path(group.full_path)
end