Module: AssociateJsonb::Associations::HasManyAssociation

Defined in:
lib/associate_jsonb/associations/has_many_association.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#delete_count(method, scope) ⇒ Object

rubocop:disable Metrics/AbcSize



8
9
10
11
12
13
# File 'lib/associate_jsonb/associations/has_many_association.rb', line 8

def delete_count(method, scope)
  return super if method == :delete_all
  return super unless store = reflection.foreign_store_attr

  scope.update_all("#{store} = #{store} #- '{#{reflection.foreign_store_key}}'")
end