method
replace
replace(record)
public
Hide source
# File activerecord/lib/active_record/associations/belongs_to_association.rb, line 9 def replace(record) if record raise_on_type_mismatch!(record) update_counters_on_replace(record) replace_keys(record) set_inverse_instance(record) @updated = true else decrement_counters remove_keys end self.target = record end