Often I need to do a one-off validation before Rails has had a chance to
convert. For example, a date. Is there a general mechanism to cause
validations to run on the raw input or do I have to resort to:
unless attributes_before_type_cast[‘date_of_loss’] =~
errors.add(‘date_of_loss’, ‘use the form: mm/dd/yyyy’)
(BTW: I know there is a date validation plugin)
View this message in context:
Sent from the RubyOnRails Users forum at Nabble.com.