codegram / date_validator

A simple, ORM agnostic, Ruby >=2.2 compatible date validator for Rails, based on ActiveModel.
http://thoughts.codegram.com/date-validation-with-rails-3
MIT License
496 stars 82 forks source link

Does :before and :after support another field in the table? #8

Closed balupton closed 13 years ago

balupton commented 13 years ago

Could I do this? validates :started_at :date => { :before => :finished_at } validates :finished_at :date => { :before => :started_at }

If so, could it be mentioned in the documentation please :D If not, could it be added please ;-)

Thanks mate, keep up the great stuff!

txus commented 13 years ago

Indeed it's possible to do exactly that, as you can see in the line 91 of the spec:

https://github.com/codegram/date_validator/blob/master/spec/date_validator_spec.rb#L91 I will add it to the docs as soon as I can, it should be there! Thanks ;)

txus commented 13 years ago

Fixed in 01fb8dd904a519546ec8eb97a149335b140da5a7

balupton commented 13 years ago

Thanks :)