Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/finders/groups_finder.rb')
-rw-r--r--app/finders/groups_finder.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/app/finders/groups_finder.rb b/app/finders/groups_finder.rb
index 63f7616884f..074eb9add0f 100644
--- a/app/finders/groups_finder.rb
+++ b/app/finders/groups_finder.rb
@@ -32,14 +32,8 @@ class GroupsFinder < UnionFinder
end
def execute
- items = all_groups.map do |item|
- item = by_parent(item)
- item = by_custom_attributes(item)
- item = filter_group_ids(item)
- item = exclude_group_ids(item)
- item = by_search(item)
-
- item
+ items = all_groups.map do |groups|
+ filter_groups(groups)
end
find_union(items, Group).with_route.order_id_desc
@@ -49,6 +43,14 @@ class GroupsFinder < UnionFinder
attr_reader :current_user, :params
+ def filter_groups(groups)
+ groups = by_parent(groups)
+ groups = by_custom_attributes(groups)
+ groups = filter_group_ids(groups)
+ groups = exclude_group_ids(groups)
+ by_search(groups)
+ end
+
def all_groups
return [owned_groups] if params[:owned]
return [groups_with_min_access_level] if min_access_level?
@@ -147,3 +149,5 @@ class GroupsFinder < UnionFinder
groups
end
end
+
+GroupsFinder.prepend_mod_with('GroupsFinder')