method

update_counters_on_replace

Importance_0
v5.2.3 - Show latest stable - 0 notes - Class: ActiveRecord::Associations::BelongsToAssociation
update_counters_on_replace(record) 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/associations/belongs_to_association.rb, line 84
        def update_counters_on_replace(record)
          if require_counter_update? && different_target?(record)
            owner.instance_variable_set :@_after_replace_counter_called, true
            record.increment!(reflection.counter_cache_column, touch: reflection.options[:touch])
            decrement_counters
          end
        end
Register or log in to add new notes.