Skip to content

Commit

Permalink
AttributeMethods refector suffix method added some usages
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuatrai authored and fxn committed Aug 13, 2011
1 parent 7963099 commit 9eb3e63
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion railties/guides/source/active_model_basics.textile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 9eb3e63

Please sign in to comment.