blob: bf23fc211242eadc438b92469fb043489cf558da (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# frozen_string_literal: true
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
delegate :execute_hooks, :execute_integrations, :group, to: :project, allow_nil: true
delegate :external_references_supported?, :default_issues_tracker?, to: :project
def self.sti_name
'Project'
end
def self.polymorphic_name
'Namespaces::ProjectNamespace'
end
end
end
|