diff options
Diffstat (limited to 'app/models/linked_user.rb')
-rw-r--r-- | app/models/linked_user.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/models/linked_user.rb b/app/models/linked_user.rb new file mode 100644 index 000000000..e049c6f77 --- /dev/null +++ b/app/models/linked_user.rb @@ -0,0 +1,17 @@ +# == Schema Information +# +# Table name: linked_users +# +# id :bigint(8) not null, primary key +# user_id :bigint(8) +# target_user_id :bigint(8) +# created_at :datetime not null +# updated_at :datetime not null +# + +class LinkedUser < ApplicationRecord + belongs_to :user, inverse_of: :linked_users + belongs_to :target_user, class_name: 'User' + + validates :user_id, uniqueness: { scope: :target_user_id } +end |