diff options
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 11b03846f0b..3c9b1d32a53 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -3,7 +3,6 @@ class Namespace < ActiveRecord::Base include CacheMarkdownField include Sortable - include Gitlab::ShellAdapter include Gitlab::VisibilityLevel include Routable include AfterCommitQueue @@ -192,9 +191,9 @@ class Namespace < ActiveRecord::Base # returns all ancestors upto but excluding the given namespace # when no namespace is given, all ancestors upto the top are returned - def ancestors_upto(top = nil) + def ancestors_upto(top = nil, hierarchy_order: nil) Gitlab::GroupHierarchy.new(self.class.where(id: id)) - .ancestors(upto: top) + .ancestors(upto: top, hierarchy_order: hierarchy_order) end def self_and_ancestors @@ -243,7 +242,7 @@ class Namespace < ActiveRecord::Base end def root_ancestor - ancestors.reorder(nil).find_by(parent_id: nil) + self_and_ancestors.reorder(nil).find_by(parent_id: nil) end def subgroup? |