I would like to validate a model on several events. I have: validates_numericality_of :ships_in, :on => :update, :message => 'xyz....' I have this validating on update, but I also want it to validate on save and on create as well. Do I have to duplicate this validator for each event? or is there something cool i can do like: :on => [:update, :save, :create] (which doesn't work) :-) Thanks for your help! Dave C
on 2006-04-19 03:42
on 2006-04-19 03:48
If you get rid of the ":on => ..." it will work for all of them. :) -Adam
on 2006-04-19 03:54
Adam Bloom wrote: > If you get rid of the ":on => ..." it will work for all of them. :) > > -Adam That's crazy talk. :-) Took the api doc too literally: on - Specifies when this validation is active (default is :save, other options :create, :update) I assumed the default would only apply to save. Thanks Adam!!