aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source
diff options
context:
space:
mode:
Diffstat (limited to 'railties/guides/source')
-rw-r--r--railties/guides/source/active_model_basics.textile13
1 files changed, 12 insertions, 1 deletions
diff --git a/railties/guides/source/active_model_basics.textile b/railties/guides/source/active_model_basics.textile
index c76469f62c..87a9658a94 100644
--- a/railties/guides/source/active_model_basics.textile
+++ b/railties/guides/source/active_model_basics.textile
@@ -30,12 +30,23 @@ private
end
def attribute_highest?(attribute)
- attribute > 100 ? true : false
+ send(attribute) > 100 ? true : false
end
end
+
+person = Person.new
+person.age = 110
+person.age_highest? # true
+person.reset_age # 0
+person.age_highest? # false
+
</ruby>
+h4. Callbacks
+
+
+
h3. Changelog
* August 5, 2011: Initial version by "Arun Agrawal":http://github.com/arunagw \ No newline at end of file