1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

[Enh] Changed the visibility of the ActiveModel::Dirty#clear_attribute_changes method

In Rails 4.2 it is impossible to define a custom default value for a model's
attribute without making it appear as _changed?, especially when the model
is first initialized. Making this method publicly visible will allow such a behaviour,
without the need to use private APIs.
This commit is contained in:
Daniele Di Bernardo 2014-11-06 19:56:20 +01:00
parent 300c96ce15
commit eb05774531

View file

@ -255,7 +255,7 @@ module ActiveModel
end
# Remove changes information for the provided attributes.
def clear_attribute_changes(attributes)
def clear_attribute_changes(attributes) # :doc:
attributes_changed_by_setter.except!(*attributes)
end
end