diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-07-29 09:18:29 -0400 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2010-07-29 09:18:29 -0400 |
commit | 1a6d76223bf6a022a5755e645742ac84788e6668 (patch) | |
tree | 40d817199e5be0d0d23b249777dcd0d3bb61cad3 /activemodel/lib | |
parent | 627d870c92e59fb5c2205df0ef897a525c9e85bc (diff) | |
download | rails-1a6d76223bf6a022a5755e645742ac84788e6668.tar.gz rails-1a6d76223bf6a022a5755e645742ac84788e6668.tar.bz2 rails-1a6d76223bf6a022a5755e645742ac84788e6668.zip |
expanding on the will_change! method in documentation
Diffstat (limited to 'activemodel/lib')
-rw-r--r-- | activemodel/lib/active_model/dirty.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/dirty.rb b/activemodel/lib/active_model/dirty.rb index 4c80863e3a..5ea7636427 100644 --- a/activemodel/lib/active_model/dirty.rb +++ b/activemodel/lib/active_model/dirty.rb @@ -83,7 +83,10 @@ module ActiveModel # person.name_changed? # => false # person.name # => 'Bill' # - # Before modifying an attribute in-place: + # 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. + # # person.name_will_change! # person.name << 'y' # person.name_change # => ['Bill', 'Billy'] |