Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

expanding on the will_change! method in documentation

  • Loading branch information...
commit 1a6d76223bf6a022a5755e645742ac84788e6668 1 parent 627d870
@neerajdotname neerajdotname authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 activemodel/lib/active_model/dirty.rb
View
5 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']
Please sign in to comment.
Something went wrong with that request. Please try again.