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

Ability to include custom restriction variable value and add the error message to base #106

Closed aditya-kapoor closed 7 years ago

aditya-kapoor commented 11 years ago

Until now, the validates_timeliness gem can only use the default restriction value which is calculated from the variable that is specified in the :on_or_before, :on_or_after, :before and :after option. Now we can specify our own restriction_value which can be interpolated in the error message.

This PR also adds the option of adding the error message to the base.

wrkrb33 commented 10 years ago

This or something like it would be nice to have. The common use case would be where you want to display the humanized name of the method that was called to obtain the restriction, rather than the value returned from that method.

aditya-kapoor commented 9 years ago

@adzap any word on this?

aditya-kapoor commented 8 years ago

@adzap any word on this?