Add specs for model facebook_page (#346)

This commit is contained in:
Karthik Sivadas
2019-12-05 13:20:04 +05:30
committed by Pranav Raj S
parent ff5c26a388
commit 3a1c0aef07
5 changed files with 33 additions and 3 deletions

View File

@@ -14,7 +14,8 @@
#
# Indexes
#
# index_channel_facebook_pages_on_page_id (page_id)
# index_channel_facebook_pages_on_page_id (page_id)
# index_channel_facebook_pages_on_page_id_and_account_id (page_id,account_id) UNIQUE
#
module Channel
@@ -22,7 +23,7 @@ module Channel
self.table_name = 'channel_facebook_pages'
validates :account_id, presence: true
validates_uniqueness_of :page_id, scope: :account_id
validates :page_id, uniqueness: { scope: :account_id }
mount_uploader :avatar, AvatarUploader
belongs_to :account