lib/acfs/resource/dirty.rb in acfs-1.1.1 vs lib/acfs/resource/dirty.rb in acfs-1.2.0
- old
+ new
@@ -6,30 +6,18 @@
extend ActiveSupport::Concern
include ActiveModel::Dirty
# @api private
#
- # Resets all changes. Does not touch previous changes.
- #
def reset_changes
- changed_attributes.clear
+ clear_changes_information
end
# @api private
#
- # Save current changes as previous changes and reset
- # current one.
- #
- def swap_changes
- @previously_changed = changes
- reset_changes
- end
-
- # @api private
- #
def save!(*)
- super.tap {|_| swap_changes }
+ super.tap {|_| changes_applied }
end
# @api private
#
def loaded!
@@ -38,10 +26,10 @@
end
# @api private
#
def write_raw_attribute(name, value, opts = {})
- attribute_will_change! name if opts[:change].nil? || opts[:change]
+ attribute_will_change!(name) if opts[:change].nil? || opts[:change]
super
end
end
end