method

destroy_row

Importance_0
v6.1.7.7 - Show latest stable - 0 notes - Class: ActiveRecord::CounterCache
destroy_row() private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/counter_cache.rb, line 175
      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
              association.decrement_counters
            end
          end
        end

        affected_rows
      end
Register or log in to add new notes.