I have an application that requires users to be in a specific age group,
or above a certain age. For simplicity sake lets say they have to be at
This is my most recent attempt to produce the desired result:
validates_exclusion_of :birthday, :in => Range.new(Date.today,
Date.parse( (18.years.ago).strftime(’%Y/%m/%d’) )),
:message => “does not meet Terms of Service requirements”
" Date.parse( (16.years.ago).strftime(’%Y/%m/%d’) ) " works as expected
in console, however the validation always results in a true state.
Also, I believe this opens a condition where a user could set their
birthday in the future. I would like to do this without plugins, it
seems simple enough.