method

init_changed_attributes

rails latest stable - Class: ActiveRecord::AttributeMethods::Dirty

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.1.8) is shown here.

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