Fix Rails/InverseOf cop (#24732)

This commit is contained in:
Matt Jankowski
2023-04-30 08:06:53 -04:00
committed by GitHub
parent 6b95aaaa65
commit af824db398
9 changed files with 33 additions and 35 deletions

View File

@ -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}%")) }