adzap / validates_timeliness

Date and time validation plugin for ActiveModel and Rails. Supports multiple ORMs and allows custom date/time formats.
MIT License
1.59k stars 227 forks source link

Range with excluded end passed to :between option should be split into :on_or_after and :before options #98

Closed 907th closed 11 years ago

907th commented 11 years ago

If you use range with excluded end in :between option, e.g.

validates_date :field, between: date1...date2

it should be treated as

validates_date :field, on_or_after: date1, before: date2

I also added test for that issue.

adzap commented 11 years ago

This sounds very reasonable and logical. Could you also add some comments to the README?

907th commented 11 years ago

I added examples to README.

adzap commented 11 years ago

There's a comment in the README under the error messages section about the :between error messages. We should have a something there also since the error message keys are different in this case. Can you please add that also? Thanks

907th commented 11 years ago

Done. Please, check it.