Bypassing validation with machinist

Posted by toofancy on Stack Overflow See other posts from Stack Overflow or by toofancy
Published on 2009-06-01T20:59:54Z Indexed on 2010/04/20 18:33 UTC
Read the original article Hit count: 451

Filed under:
|
|

Hi,

I am writing my specs on my model Thing which has a date field which should be after the date of creation, thus I use the *validate_timeliness* plugin like that

validate_date :date, :after Time.now

I want to be able to add some Things with an anterior date but validation fails. I want to bypass the validation when creating some Things with the machinist factory.

Any clue ?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about rspec