aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-06-27 13:07:25 -0600
committerSean Griffin <sean@thoughtbot.com>2014-06-27 13:07:25 -0600
commite04c4c08200a15cfbc7019358dbe41399fa258f9 (patch)
treebe6ea58e9e30020412fd999b3231039760b86b83 /activemodel
parent30b56084fb67d99fa3284d34c9bb914ebee378b6 (diff)
downloadrails-e04c4c08200a15cfbc7019358dbe41399fa258f9.tar.gz
rails-e04c4c08200a15cfbc7019358dbe41399fa258f9.tar.bz2
rails-e04c4c08200a15cfbc7019358dbe41399fa258f9.zip
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.
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/dirty.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb
index 98ffffeb10..48dd54a7b0 100644
--- a/activemodel/lib/active_model/dirty.rb
+++ b/activemodel/lib/active_model/dirty.rb
@@ -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"]