diff options
Diffstat (limited to 'railties/guides/source/active_model_basics.textile')
-rw-r--r-- | railties/guides/source/active_model_basics.textile | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/railties/guides/source/active_model_basics.textile b/railties/guides/source/active_model_basics.textile index 0672669dc5..9c8ad24cee 100644 --- a/railties/guides/source/active_model_basics.textile +++ b/railties/guides/source/active_model_basics.textile @@ -163,12 +163,14 @@ person.first_name_changed? #=> true </ruby> Track what was the previous value of the attribute. + <ruby> #attr_name_was accessor person.first_name_was #=> "First Name" </ruby> Track both previous and current value of the changed attribute. Returns an array if changed else returns nil + <ruby> #attr_name_change person.first_name_change #=> ["First Name", "First Name 1"] @@ -201,8 +203,3 @@ person.valid? #=> true person.token = nil person.valid? #=> raises ActiveModel::StrictValidationFailed </ruby> - -h3. Changelog - -* August 24, 2011: Add strict validation usage example. "Bogdan Gusiev":http://gusiev.com -* August 5, 2011: Initial version by "Arun Agrawal":http://github.com/arunagw |