Fix Rails/InverseOf cop (#24732)
This commit is contained in:
parent
6b95aaaa65
commit
af824db398
9 changed files with 33 additions and 35 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
|
||||
has_many :accounts, foreign_key: :domain, primary_key: :domain, inverse_of: false
|
||||
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