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

Wrong type of error in different cases #31

Closed nathansamson closed 11 years ago

nathansamson commented 12 years ago

Case 1: validates :birth_date, :date => true, :presence => true When not entering anything it reports: 'not a date', which is kind of true, but a better error would be the rails 'must be given'

Case 2: validates :birth_date, :date => true, :presence => true, :allow_nil => true Added the allow_nil clause to fix previous error. Now that works but the following case is incorrect Entering '28-04-89' gives also 'must be given' which is incorrect, correct error should be 'not a date'...

txus commented 12 years ago

Would you give a try at fixing this?

oriolgual commented 11 years ago

The second case is probably related to #37.