From e9eae3eb0dd25e4a34c9a4b6bcc7de312dde4489 Mon Sep 17 00:00:00 2001 From: Markus Koller Date: Thu, 28 Sep 2017 16:49:42 +0000 Subject: Support custom attributes on users --- app/models/user_custom_attribute.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 app/models/user_custom_attribute.rb (limited to 'app/models/user_custom_attribute.rb') 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 -- cgit v1.2.1