rails/rails — pull request #8979 by mattdbridges (2013-01-17 16:04:33+00:00)
Title: Adding :in and :within options to `validates_numericality_of`

Behaves similarly to length validation, except that it checks to see if the given value is covered by the given `Range`.

```ruby
class Timer
include ActiveModel::Validations

att_accessor :duration
validates_numericality_of :duration, in: 1..200
end

timer = Timer.new
timer.duration = 201
timer.valid?
# => false
timer.errors.messsages
# => {:duration => ["must be less than or equal to 200"]}
```