module DirtyNestedAttributes::ChangedAssociations

:nodoc

Public Instance Methods

attribute_change(attr) click to toggle source
Calls superclass method
# File lib/dirty_nested_attributes/changed_associations.rb, line 4
def attribute_change(attr)
  changed_association = association(attr)
  if changed_association && attribute_changed?(attr)
    if changed_association.reflection.collection?
      changed_attributes[attr].map(&:changes)
    else
      changed_attributes[attr].changes
    end
  end
rescue ActiveRecord::AssociationNotFoundError
  super
end