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 -- Posted via http://www.ruby-forum.com/.
If you get rid of the ":on => ..." it will work for all of them. :) -Adam -- Posted via http://www.ruby-forum.com/.
Adam Bloom wrote:> If you get rid of the ":on => ..." it will work for all of them. :) > > -AdamThat''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!! -- Posted via http://www.ruby-forum.com/.