method
init_changed_attributes
rails latest stable - Class:
ActiveRecord::AttributeMethods::Dirty
init_changed_attributes()private
No documentation available.
# File activerecord/lib/active_record/attribute_methods/dirty.rb, line 52
def init_changed_attributes
@changed_attributes = nil
# Intentionally avoid using #column_defaults since overridden defaults (as is done in
# optimistic locking) won't get written unless they get marked as changed
self.class.columns.each do |c|
attr, orig_value = c.name, c.default
changed_attributes[attr] = orig_value if _field_changed?(attr, orig_value, @attributes[attr])
end
end