aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/active_model_basics.textile
diff options
context:
space:
mode:
Diffstat (limited to 'railties/guides/source/active_model_basics.textile')
-rw-r--r--railties/guides/source/active_model_basics.textile2
1 files changed, 2 insertions, 0 deletions
diff --git a/railties/guides/source/active_model_basics.textile b/railties/guides/source/active_model_basics.textile
index 0672669dc5..73df567579 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"]