Skip to content

Commit

Permalink
Tidy up association declaration in Instance model (mastodon#28880)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski committed Jan 24, 2024
1 parent 9c5be13 commit 38f7f8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class Instance < ApplicationRecord

attr_accessor :failure_days

has_many :accounts, foreign_key: :domain, primary_key: :domain, inverse_of: false

with_options foreign_key: :domain, primary_key: :domain, inverse_of: false do
belongs_to :domain_block
belongs_to :domain_allow
belongs_to :unavailable_domain # skipcq: RB-RL1031
belongs_to :unavailable_domain

has_many :accounts, dependent: nil
end

scope :searchable, -> { where.not(domain: DomainBlock.select(:domain)) }
Expand Down

0 comments on commit 38f7f8b

Please sign in to comment.