From 38f7f8b9096a3c56c676942730184f01e17bd93d Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 24 Jan 2024 12:30:28 -0500 Subject: [PATCH] Tidy up association declaration in `Instance` model (#28880) --- app/models/instance.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/instance.rb b/app/models/instance.rb index 8f8d87c62a..2dec75d6fe 100644 --- a/app/models/instance.rb +++ b/app/models/instance.rb @@ -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)) }