diff options
author | Vishnu Atrai <vishnu.atrai@gmail.com> | 2011-08-05 13:34:28 +0530 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2011-08-13 16:22:31 -0700 |
commit | 9eb3e637fb7ffa7a35847b5dd577c3a2736e5101 (patch) | |
tree | 4ef7900dae3ece7775474dd52b1d941c9cc157b2 | |
parent | 7963099b904031fef7d593d5be7e2061d1bcbfe8 (diff) | |
download | rails-9eb3e637fb7ffa7a35847b5dd577c3a2736e5101.tar.gz rails-9eb3e637fb7ffa7a35847b5dd577c3a2736e5101.tar.bz2 rails-9eb3e637fb7ffa7a35847b5dd577c3a2736e5101.zip |
AttributeMethods refector suffix method added some usages
-rw-r--r-- | railties/guides/source/active_model_basics.textile | 13 |
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 |