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

Note that _will_change! is no longer needed for AR instances

Leave the note for `ActiveModel`, since it can't yet detect mutations
(hopefully we can change this in time for 4.2). However, we now detect
mutations on all supported types in `ActiveRecord`, so we can note that
`_will_change!` is no longer needed there.
This commit is contained in:
Sean Griffin 2014-06-27 13:07:25 -06:00
parent 30b56084fb
commit e04c4c0820

View file

@ -84,9 +84,11 @@ module ActiveModel
# person.changed # => ["name"]
# person.changes # => {"name" => ["Bill", "Bob"]}
#
# If an attribute is modified in-place then make use of <tt>[attribute_name]_will_change!</tt>
# to mark that the attribute is changing. Otherwise ActiveModel can't track
# changes to in-place attributes.
# If an attribute is modified in-place then make use of
# +[attribute_name]_will_change!+ to mark that the attribute is changing.
# Otherwise ActiveModel can't track changes to in-place attributes. Note
# that ActiveRecord can detect in-place modifications automatically. You do
# not need to call +[attribute_name]_will_change!+ on ActiveRecord models.
#
# person.name_will_change!
# person.name_change # => ["Bill", "Bill"]