summaryrefslogtreecommitdiff
path: root/app/models/namespaces/traversal/recursive.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/namespaces/traversal/recursive.rb')
-rw-r--r--app/models/namespaces/traversal/recursive.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/models/namespaces/traversal/recursive.rb b/app/models/namespaces/traversal/recursive.rb
index 53eac27aa54..1c5d395cb3c 100644
--- a/app/models/namespaces/traversal/recursive.rb
+++ b/app/models/namespaces/traversal/recursive.rb
@@ -63,19 +63,17 @@ module Namespaces
# Returns all the descendants of the current namespace.
def descendants
- object_hierarchy(self.class.where(parent_id: id))
- .base_and_descendants
+ object_hierarchy(self.class.where(parent_id: id)).base_and_descendants
end
alias_method :recursive_descendants, :descendants
def self_and_descendants
- object_hierarchy(self.class.where(id: id))
- .base_and_descendants
+ object_hierarchy(self.class.where(id: id)).base_and_descendants
end
alias_method :recursive_self_and_descendants, :self_and_descendants
def self_and_descendant_ids
- recursive_self_and_descendants.select(:id)
+ object_hierarchy(self.class.where(id: id)).base_and_descendant_ids
end
alias_method :recursive_self_and_descendant_ids, :self_and_descendant_ids