Sha256: 2dc718cbed95325e0be41730646c04934b6b752ef7935ea6c911f6753c45e2dd

Contents?: true

Size: 487 Bytes

Versions: 3

Compression:

Stored size: 487 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

3 entries across 3 versions & 1 rubygems

Version Path
atomically-1.1.5 lib/atomically/patches/clear_attribute_changes.rb
atomically-1.1.4 lib/atomically/patches/clear_attribute_changes.rb
atomically-1.1.3 lib/atomically/patches/clear_attribute_changes.rb