提交 e04c4c08 编写于 作者: S Sean Griffin

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.
上级 30b56084
......@@ -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"]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册