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/models/namespaces/traversal/recursive.rb')
-rw-r--r--app/models/namespaces/traversal/recursive.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/namespaces/traversal/recursive.rb b/app/models/namespaces/traversal/recursive.rb
index 409438f53d2..5a1a9d24117 100644
--- a/app/models/namespaces/traversal/recursive.rb
+++ b/app/models/namespaces/traversal/recursive.rb
@@ -16,6 +16,7 @@ module Namespaces
parent.root_ancestor
end
end
+ alias_method :recursive_root_ancestor, :root_ancestor
# Returns all ancestors, self, and descendants of the current namespace.
def self_and_hierarchy
@@ -61,6 +62,11 @@ module Namespaces
end
alias_method :recursive_self_and_descendants, :self_and_descendants
+ def self_and_descendant_ids
+ self_and_descendants.select(:id)
+ end
+ alias_method :recursive_self_and_descendant_ids, :self_and_descendant_ids
+
def object_hierarchy(ancestors_base)
Gitlab::ObjectHierarchy.new(ancestors_base, options: { use_distinct: Feature.enabled?(:use_distinct_in_object_hierarchy, self) })
end