summaryrefslogtreecommitdiff
path: root/app/models/project_custom_attribute.rb
diff options
context:
space:
mode:
authorMarkus Koller <markus-koller@gmx.ch>2017-09-18 15:03:24 +0200
committerMarkus Koller <markus.koller.ext@siemens.com>2017-11-06 10:51:46 +0100
commit6902848a9c54f9eb1bfd82fe173ad0d5d62fe2d5 (patch)
tree9a28f3a4e52c7e6108a7f0358f813a375eec90a2 /app/models/project_custom_attribute.rb
parent823a9d351b49a6be8c12cfe06edb4aa6ec08fe95 (diff)
downloadgitlab-ce-6902848a9c54f9eb1bfd82fe173ad0d5d62fe2d5.tar.gz
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