Sha256: 462ccba350da0ff605e7f5a6085f27fcdf1ebefe626ba84ede9504265e8a330d

Contents?: true

Size: 470 Bytes

Versions: 8

Compression:

Stored size: 470 Bytes

Contents

module ActiveModel
  module Dirty
    private

    alias attributes_changed_by_setter changed_attributes # :nodoc:

    # Force an attribute to have a particular "before" value
    def set_attribute_was(attr, old_value)
      attributes_changed_by_setter[attr] = old_value
    end

    # Remove changes information for the provided attributes.
    def clear_attribute_changes(attributes) # :doc:
      attributes_changed_by_setter.except!(*attributes)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
atomically-1.1.2 lib/atomically/patches/clear_attribute_changes.rb
atomically-1.1.1 lib/atomically/patches/clear_attribute_changes.rb
atomically-1.1.0 lib/atomically/patches/clear_attribute_changes.rb
atomically-1.0.6 lib/atomically/patches/clear_attribute_changes.rb
atomically-1.0.5 lib/atomically/patches/clear_attribute_changes.rb
atomically-1.0.4 lib/atomically/patches/clear_attribute_changes.rb
atomically-1.0.3 lib/atomically/patches/clear_attribute_changes.rb
atomically-1.0.2 lib/atomically/patches/clear_attribute_changes.rb