Move Account#domain_blocks declaration from interactions->associations

This commit is contained in:
Matt Jankowski 2024-11-19 09:38:51 -05:00
parent 37f00fb018
commit f99b24cc5d
3 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -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