method
destroy_row
v5.2.3 -
Show latest stable
- Class:
ActiveRecord::CounterCache
destroy_row()private
No documentation available.
# File activerecord/lib/active_record/counter_cache.rb, line 195
def destroy_row
affected_rows = super
if affected_rows > 0
each_counter_cached_associations do |association|
foreign_key = association.reflection.foreign_key.to_sym
unless destroyed_by_association && destroyed_by_association.foreign_key.to_sym == foreign_key
if send(association.reflection.name)
association.decrement_counters
end
end
end
end
affected_rows
end