Class: Projects::GroupsFinder

Inherits:
UnionFinder show all
Defined in:
app/finders/projects/groups_finder.rb

Instance Method Summary collapse

Methods inherited from UnionFinder

#find_union

Constructor Details

#initialize(project:, current_user: nil, params: {}) ⇒ GroupsFinder

Returns a new instance of GroupsFinder.



16
17
18
19
20
# File 'app/finders/projects/groups_finder.rb', line 16

def initialize(project:, current_user: nil, params: {})
  @project = project
  @current_user = current_user
  @params = params
end

Instance Method Details

#executeObject



22
23
24
25
26
27
28
29
30
31
# File 'app/finders/projects/groups_finder.rb', line 22

def execute
  return Group.none unless authorized?

  items = all_groups.map do |item|
    item = exclude_group_ids(item)
    item
  end

  find_union(items, Group).with_route.order_id_desc
end