method

update_counters_on_replace

Importance_0
v5.0.0.1 - 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 62
        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)
            decrement_counters
          end
        end
Register or log in to add new notes.