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:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-10-10 17:07:41 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-10 17:55:02 +0300
commit9d54da23610dcb2f4bfd63aa67a9e01c20f01d38 (patch)
tree25552a814061469c190a4af8d310a367339a3d32 /lib/gitlab/group_hierarchy.rb
parente55886b30ec80cef8b5c956cf1f0b1e0c6419fc9 (diff)
Reuse `base_and_ancestors` for `ancestors` in `GroupHierarchy`
Diffstat (limited to 'lib/gitlab/group_hierarchy.rb')
-rw-r--r--lib/gitlab/group_hierarchy.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/gitlab/group_hierarchy.rb b/lib/gitlab/group_hierarchy.rb
index d88c415e1e5..42ded7c286f 100644
--- a/lib/gitlab/group_hierarchy.rb
+++ b/lib/gitlab/group_hierarchy.rb
@@ -30,8 +30,7 @@ module Gitlab
# reached. So all ancestors *lower* than the specified ancestor will be
# included.
def ancestors(upto: nil)
- read_only(base_and_ancestors_cte(upto).apply_to(model.all))
- .where.not(id: ancestors_base.select(:id))
+ base_and_ancestors(upto: upto).where.not(id: ancestors_base.select(:id))
end
# Returns a relation that includes the ancestors_base set of groups