mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-22 14:15:22 +00:00
Move Account#domain_blocks
declaration from interactions->associations
This commit is contained in:
parent
37f00fb018
commit
f99b24cc5d
|
@ -15,7 +15,8 @@ class AccountDomainBlock < ApplicationRecord
|
||||||
include Paginable
|
include Paginable
|
||||||
include DomainNormalizable
|
include DomainNormalizable
|
||||||
|
|
||||||
belongs_to :account
|
belongs_to :account, inverse_of: :domain_blocks
|
||||||
|
|
||||||
validates :domain, presence: true, uniqueness: { scope: :account_id }, domain: true
|
validates :domain, presence: true, uniqueness: { scope: :account_id }, domain: true
|
||||||
|
|
||||||
after_commit :invalidate_domain_blocking_cache
|
after_commit :invalidate_domain_blocking_cache
|
||||||
|
|
|
@ -15,6 +15,7 @@ module Account::Associations
|
||||||
has_many :bookmarks
|
has_many :bookmarks
|
||||||
has_many :conversations, class_name: 'AccountConversation'
|
has_many :conversations, class_name: 'AccountConversation'
|
||||||
has_many :custom_filters
|
has_many :custom_filters
|
||||||
|
has_many :domain_blocks, class_name: 'AccountDomainBlock'
|
||||||
has_many :favourites
|
has_many :favourites
|
||||||
has_many :featured_tags, -> { includes(:tag) }
|
has_many :featured_tags, -> { includes(:tag) }
|
||||||
has_many :list_accounts
|
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 :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 :muted_by, -> { order(mutes: { id: :desc }) }, through: :muted_by_relationships, source: :account
|
||||||
has_many :conversation_mutes, dependent: :destroy
|
has_many :conversation_mutes, dependent: :destroy
|
||||||
has_many :domain_blocks, class_name: 'AccountDomainBlock', dependent: :destroy
|
|
||||||
has_many :announcement_mutes, dependent: :destroy
|
has_many :announcement_mutes, dependent: :destroy
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue