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:
parent
300c96ce15
commit
eb05774531
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue