diff --git a/app/models/concerns/group_descendant.rb b/app/models/concerns/group_descendant.rb index 89a91f87a46..12c16a2cf5b 100644 --- a/app/models/concerns/group_descendant.rb +++ b/app/models/concerns/group_descendant.rb @@ -3,14 +3,6 @@ module GroupDescendant expand_hierarchy_for_child(self, self, hierarchy_base) end - def parent - if self.is_a?(Project) - namespace - else - super - end - end - def expand_hierarchy_for_child(child, hierarchy, hierarchy_base) if child.parent.nil? && hierarchy_base.present? raise ArgumentError.new('specified base is not part of the tree') diff --git a/app/models/project.rb b/app/models/project.rb index bf883de48ed..ad0b717308a 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -1521,6 +1521,10 @@ class Project < ActiveRecord::Base map.public_path_for_source_path(path) end + def parent + namespace + end + def parent_changed? namespace_id_changed? end