diff options
Diffstat (limited to 'app/models/block.rb')
-rw-r--r-- | app/models/block.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/block.rb b/app/models/block.rb new file mode 100644 index 000000000..418afdbdf --- /dev/null +++ b/app/models/block.rb @@ -0,0 +1,7 @@ +class Block < ApplicationRecord + belongs_to :account + belongs_to :target_account, class_name: 'Account' + + validates :account, :target_account, presence: true + validates :account_id, uniqueness: { scope: :target_account_id } +end |