adzap/validates_timeliness — pull request #117 by johncarney (2014-05-02 05:14:11+00:00)
Title: Remove #setup method, which is deprecated in Rails 4.

Defining `#setup` on Validators is deprecated in Rails 4.1 and is planned to be removed altogether in Rails 4.2. In the meantime, defining `setup` causes deprecation warnings.

This patch is cribbed from a couple of suggested solutions discussed in issue #114 and suppresses deprecation warnings in Rails 4.1 and will work in Rails 4.2, as well as older versions.

I haven't included any tests because I couldn't figure out how to cleanly mimic the different behaviours of different Rails versions.