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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-07 00:10:07 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-07 00:10:07 +0300
commit454973238cb3eed58f7d901b87ceb29acf6febbd (patch)
tree340dd978fd9df37553733b3244383c4bc9b3ceea /app/models/namespaces/traversal/linear.rb
parent52dbfea964ea55b3393dc4146e541bc651f7e9e3 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/namespaces/traversal/linear.rb')
-rw-r--r--app/models/namespaces/traversal/linear.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/namespaces/traversal/linear.rb b/app/models/namespaces/traversal/linear.rb
index 3ebf0894b98..be43b2e04f7 100644
--- a/app/models/namespaces/traversal/linear.rb
+++ b/app/models/namespaces/traversal/linear.rb
@@ -63,6 +63,12 @@ module Namespaces
lineage(top: self)
end
+ def descendants
+ return super unless use_traversal_ids?
+
+ self_and_descendants.where.not(id: id)
+ end
+
def ancestors(hierarchy_order: nil)
return super() unless use_traversal_ids?
return super() unless Feature.enabled?(:use_traversal_ids_for_ancestors, root_ancestor, default_enabled: :yaml)