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/project_namespace.rb')
-rw-r--r--app/models/namespaces/project_namespace.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/namespaces/project_namespace.rb b/app/models/namespaces/project_namespace.rb
index fbd87e3232d..2a2ea11ddc5 100644
--- a/app/models/namespaces/project_namespace.rb
+++ b/app/models/namespaces/project_namespace.rb
@@ -2,6 +2,13 @@
module Namespaces
class ProjectNamespace < Namespace
+ # These aliases are added to make it easier to sync parent/parent_id attribute with
+ # project.namespace/project.namespace_id attribute.
+ #
+ # TODO: we can remove these attribute aliases when we no longer need to sync these with project model,
+ # see project#sync_attributes
+ alias_attribute :namespace, :parent
+ alias_attribute :namespace_id, :parent_id
has_one :project, foreign_key: :project_namespace_id, inverse_of: :project_namespace
def self.sti_name