so i have a model with two date attributes
# migration
t.date :valid_from
t.date :valid_until
these are optional and you should be able to define only valid_from or valid_until, but if both dates are filled i want (of course) that valid_from is earlier than valid_until.
the best place to check for this, is inside the model with a validator, isnt it? i think the controller would not be the best place for this.
how could this be done with a validator inside my model? i tried several things without luck.
You could use a custom validator: