This post originated from an RSS feed registered with Ruby Buzz
by rwdaigle.
Original Post: What's New in Edge Rails: validates_numericality_of Gets Pimped
Feed Title: Ryan's Scraps
Feed URL: http://feeds.feedburner.com/RyansScraps
Feed Description: Ryan Daigle's various technically inclined rants along w/ the "What's new in Edge Rails" series.
validates_numericality_ofjust got a shot of mojo this weekend in the form of some highly useful options.
Prior to this recent change, your numerical validation options were limited to only_integer and allow_nil. Any desires to do anything slightly more complex meant dropping down into your own validation routine. Now, some of the more common validations one might want on a number parameter have been option-ized, including: