diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-07 00:10:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-07 00:10:07 +0300 |
commit | 454973238cb3eed58f7d901b87ceb29acf6febbd (patch) | |
tree | 340dd978fd9df37553733b3244383c4bc9b3ceea /app/models/namespaces/traversal | |
parent | 52dbfea964ea55b3393dc4146e541bc651f7e9e3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/namespaces/traversal')
-rw-r--r-- | app/models/namespaces/traversal/linear.rb | 6 |
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) |