lib/superstore/attribute_methods/dirty.rb in superstore-1.0.3 vs lib/superstore/attribute_methods/dirty.rb in superstore-1.0.4

- old
+ new

@@ -19,9 +19,15 @@ @previously_changed.try :clear @changed_attributes.try :clear end end + def unapplied_changes + result = {} + changed_attributes.each_key { |attr| result[attr] = read_attribute(attr) } + result + end + def write_attribute(name, value) name = name.to_s old = read_attribute(name) super