diff options
author | Jarka Košanová <jarka@gitlab.com> | 2018-12-18 13:15:51 +0100 |
---|---|---|
committer | Jarka Košanová <jarka@gitlab.com> | 2018-12-19 15:24:29 +0100 |
commit | b1c39553859bb1f5f830fa759f2202462fe24d98 (patch) | |
tree | 235757cdbb225f709ecf105187b69a5f39c711bf /app/finders | |
parent | b1b7fa7802eecbacff04a9434eff69b0f3cbaaad (diff) | |
download | gitlab-ce-b1c39553859bb1f5f830fa759f2202462fe24d98.tar.gz |
Rename GroupHierarchy into ObjectHierarchy
- we now use the hierarchy class also for epics
- also rename supports_nested_groups? into supports_nested_objects?
- move it to a concern
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/group_descendants_finder.rb | 6 | ||||
-rw-r--r-- | app/finders/groups_finder.rb | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/app/finders/group_descendants_finder.rb b/app/finders/group_descendants_finder.rb index a9ce5be13f3..96a36db7ec8 100644 --- a/app/finders/group_descendants_finder.rb +++ b/app/finders/group_descendants_finder.rb @@ -112,7 +112,7 @@ class GroupDescendantsFinder # rubocop: disable CodeReuse/ActiveRecord def ancestors_of_groups(base_for_ancestors) group_ids = base_for_ancestors.except(:select, :sort).select(:id) - Gitlab::GroupHierarchy.new(Group.where(id: group_ids)) + Gitlab::ObjectHierarchy.new(Group.where(id: group_ids)) .base_and_ancestors(upto: parent_group.id) end # rubocop: enable CodeReuse/ActiveRecord @@ -132,7 +132,7 @@ class GroupDescendantsFinder end def subgroups - return Group.none unless Group.supports_nested_groups? + return Group.none unless Group.supports_nested_objects? # When filtering subgroups, we want to find all matches withing the tree of # descendants to show to the user @@ -183,7 +183,7 @@ class GroupDescendantsFinder # rubocop: disable CodeReuse/ActiveRecord def hierarchy_for_parent - @hierarchy ||= Gitlab::GroupHierarchy.new(Group.where(id: parent_group.id)) + @hierarchy ||= Gitlab::ObjectHierarchy.new(Group.where(id: parent_group.id)) end # rubocop: enable CodeReuse/ActiveRecord end diff --git a/app/finders/groups_finder.rb b/app/finders/groups_finder.rb index ea954f98220..0080123407d 100644 --- a/app/finders/groups_finder.rb +++ b/app/finders/groups_finder.rb @@ -46,7 +46,7 @@ class GroupsFinder < UnionFinder return [Group.all] if current_user&.full_private_access? && all_available? groups = [] - groups << Gitlab::GroupHierarchy.new(groups_for_ancestors, groups_for_descendants).all_groups if current_user + groups << Gitlab::ObjectHierarchy.new(groups_for_ancestors, groups_for_descendants).all_objects if current_user groups << Group.unscoped.public_to_user(current_user) if include_public_groups? groups << Group.none if groups.empty? groups @@ -66,7 +66,7 @@ class GroupsFinder < UnionFinder .groups .where('members.access_level >= ?', params[:min_access_level]) - Gitlab::GroupHierarchy + Gitlab::ObjectHierarchy .new(groups) .base_and_descendants end |