What is the best way to validate date periods? I have a model which has
two date attributes, and the user is not able to create a new record if
date1 is greater than date2. I tried using validates_numericality_of but
it doesn't work with dates.
Hello,
What is the best way to validate date periods? I have a model which has
two date attributes, and the user is not able to create a new record if
date1 is greater than date2. I tried using validates_numericality_of but
it doesn't work with dates.
I created my
own validator for dates checking for the correct order and for valid
dates. I check valid dates by creating and catchng the exception if
the date is invalid.