about summary refs log tree commit diff
path: root/app/models/chat_account.rb
blob: 41589a395f22c4fd76a83cf2adf20fd7408d2d80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# == Schema Information
#
# Table name: chat_accounts
#
#  id         :bigint(8)        not null, primary key
#  account_id :bigint(8)        not null
#  tag_id     :bigint(8)        not null
#  created_at :datetime         not null
#  updated_at :datetime         not null
#

class ChatAccount < ApplicationRecord
  belongs_to :account, inverse_of: :chat_accounts
  belongs_to :tag, inverse_of: :chat_accounts

  validates :account_id, uniqueness: { scope: :tag_id }
end