Class: Organizations::GroupsFinder

Inherits:
GroupsFinder show all
Defined in:
app/finders/organizations/groups_finder.rb

Instance Attribute Summary

Attributes inherited from GroupsFinder

#current_user, #params

Instance Method Summary collapse

Methods inherited from GroupsFinder

#initialize

Methods included from CustomAttributesFilter

#by_custom_attributes

Methods inherited from UnionFinder

#find_union

Constructor Details

This class inherits a constructor from GroupsFinder

Instance Method Details

#executeObject



5
6
7
8
9
10
11
12
13
14
15
# File 'app/finders/organizations/groups_finder.rb', line 5

def execute
  groups = find_union(filtered_groups, Group)
  groups = groups.without_deleted

  unless default_organization?
    cte = Gitlab::SQL::CTE.new(:filtered_groups_cte, groups, materialized: false)
    groups = Group.with(cte.to_arel).from(cte.alias_to(Group.arel_table)) # rubocop: disable CodeReuse/ActiveRecord -- CTE use
  end

  sort(groups).with_route
end