From 9eb3e637fb7ffa7a35847b5dd577c3a2736e5101 Mon Sep 17 00:00:00 2001 From: Vishnu Atrai Date: Fri, 5 Aug 2011 13:34:28 +0530 Subject: AttributeMethods refector suffix method added some usages --- railties/guides/source/active_model_basics.textile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'railties/guides/source') 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 + +h4. Callbacks + + + h3. Changelog * August 5, 2011: Initial version by "Arun Agrawal":http://github.com/arunagw \ No newline at end of file -- cgit v1.2.3