summaryrefslogtreecommitdiff
path: root/app/models/user_custom_attribute.rb
diff options
context:
space:
mode:
authorMarkus Koller <markus-koller@gmx.ch>2017-09-28 16:49:42 +0000
committerRémy Coutable <remy@rymai.me>2017-09-28 16:49:42 +0000
commite9eae3eb0dd25e4a34c9a4b6bcc7de312dde4489 (patch)
treed2402a99dd96927ae458f49cbd7de8ad043e297a /app/models/user_custom_attribute.rb
parent93a33556e3e01a83c1af9c21e11ff433b624c40d (diff)
downloadgitlab-ce-e9eae3eb0dd25e4a34c9a4b6bcc7de312dde4489.tar.gz
Support custom attributes on users
Diffstat (limited to 'app/models/user_custom_attribute.rb')
-rw-r--r--app/models/user_custom_attribute.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/user_custom_attribute.rb b/app/models/user_custom_attribute.rb
new file mode 100644
index 00000000000..eff25b31f9b
--- /dev/null
+++ b/app/models/user_custom_attribute.rb
@@ -0,0 +1,6 @@
+class UserCustomAttribute < ActiveRecord::Base
+ belongs_to :user
+
+ validates :user_id, :key, :value, presence: true
+ validates :key, uniqueness: { scope: [:user_id] }
+end