Add explicit dependent: nil
to associations (#28169)
This commit is contained in:
parent
1564799952
commit
f70f39dd04
10 changed files with 20 additions and 30 deletions
|
@ -25,7 +25,7 @@ class DomainBlock < ApplicationRecord
|
|||
|
||||
validates :domain, presence: true, uniqueness: true, domain: true
|
||||
|
||||
has_many :accounts, foreign_key: :domain, primary_key: :domain, inverse_of: false
|
||||
has_many :accounts, foreign_key: :domain, primary_key: :domain, inverse_of: false, dependent: nil
|
||||
delegate :count, to: :accounts, prefix: true
|
||||
|
||||
scope :matches_domain, ->(value) { where(arel_table[:domain].matches("%#{value}%")) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue