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.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/namespaces/project_namespace.rb b/app/models/namespaces/project_namespace.rb
new file mode 100644
index 00000000000..d1806c1c088
--- /dev/null
+++ b/app/models/namespaces/project_namespace.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+module Namespaces
+ class ProjectNamespace < Namespace
+ has_one :project, foreign_key: :project_namespace_id, inverse_of: :project_namespace
+
+ validates :project, presence: true
+
+ def self.sti_name
+ 'Project'
+ end
+ end
+end