mirror of https://github.com/tootsuite/mastodon
Move `Account#domain_blocks` declaration from interactions->associations
parent
37f00fb018
commit
f99b24cc5d
|
@ -15,7 +15,8 @@ class AccountDomainBlock < ApplicationRecord
|
|||
include Paginable
|
||||
include DomainNormalizable
|
||||
|
||||
belongs_to :account
|
||||
belongs_to :account, inverse_of: :domain_blocks
|
||||
|
||||
validates :domain, presence: true, uniqueness: { scope: :account_id }, domain: true
|
||||
|
||||
after_commit :invalidate_domain_blocking_cache
|
||||
|
|
|
@ -15,6 +15,7 @@ module Account::Associations
|
|||
has_many :bookmarks
|
||||
has_many :conversations, class_name: 'AccountConversation'
|
||||
has_many :custom_filters
|
||||
has_many :domain_blocks, class_name: 'AccountDomainBlock'
|
||||
has_many :favourites
|
||||
has_many :featured_tags, -> { includes(:tag) }
|
||||
has_many :list_accounts
|
||||
|
|
|
@ -107,7 +107,6 @@ module Account::Interactions
|
|||
has_many :muting, -> { order(mutes: { id: :desc }) }, through: :mute_relationships, source: :target_account
|
||||
has_many :muted_by, -> { order(mutes: { id: :desc }) }, through: :muted_by_relationships, source: :account
|
||||
has_many :conversation_mutes, dependent: :destroy
|
||||
has_many :domain_blocks, class_name: 'AccountDomainBlock', dependent: :destroy
|
||||
has_many :announcement_mutes, dependent: :destroy
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue