summaryrefslogtreecommitdiff
path: root/app/models/user_custom_attribute.rb
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-10-03 09:46:11 -0500
committerJose Ivan Vargas <jvargas@gitlab.com>2017-10-03 09:46:11 -0500
commit3130262e880efd4f0df9dd2c62fa0fd23934b0e7 (patch)
treecc07669a4b6f2e8da20675acf80b2ea58b0920fe /app/models/user_custom_attribute.rb
parentc14617709498eebef1755ee67c51f6e428ebbbce (diff)
parent18fee3060c78e032777b5dc6b3d1f60432446ea5 (diff)
downloadgitlab-ce-3130262e880efd4f0df9dd2c62fa0fd23934b0e7.tar.gz
Merge branch 'master' into 38031-monitoring-hover-info-is-clipped38031-monitoring-hover-info-is-clipped
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