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:
authorMarkus Koller <markus-koller@gmx.ch>2017-09-18 16:03:24 +0300
committerMarkus Koller <markus.koller.ext@siemens.com>2017-11-06 12:51:46 +0300
commit6902848a9c54f9eb1bfd82fe173ad0d5d62fe2d5 (patch)
tree9a28f3a4e52c7e6108a7f0358f813a375eec90a2 /app/models/project_custom_attribute.rb
parent823a9d351b49a6be8c12cfe06edb4aa6ec08fe95 (diff)
Support custom attributes on projects
Diffstat (limited to 'app/models/project_custom_attribute.rb')
-rw-r--r--app/models/project_custom_attribute.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/project_custom_attribute.rb b/app/models/project_custom_attribute.rb
new file mode 100644
index 00000000000..3f1a7b86a82
--- /dev/null
+++ b/app/models/project_custom_attribute.rb
@@ -0,0 +1,6 @@
+class ProjectCustomAttribute < ActiveRecord::Base
+ belongs_to :project
+
+ validates :project, :key, :value, presence: true
+ validates :key, uniqueness: { scope: [:project_id] }
+end