This project is archived and is in readonly mode.
date_select may call TimelinessDateTime.change which doesn't exist
-
Martijn Vos
This fix can also be found in http://github.com/mcv/rails/comm...
-
Geoff Buesing
- State changed from new to invalid
The TimelinessDateTime class isn't defined by Rails -- looks like you're using the validates_timeliness plugin:
http://github.com/adzap/validate...
This fix needs to happen in this plugin -- a simple #change method on that class would probably do the trick (for this case, at least.)
(Fyi, standard Ruby Time, Date and DateTime classes don't define #day= setter methods -- you can only set these values on object initialization.)
-
Martijn Vos
Even so, isn't it dangerous for Rails to blindly assume that it receives a class of a specific type when that clearly isn't automatically true? A respond_to? check seems very sensible to me.
-
Geoff Buesing
I don't agree. The only reason you're getting a class that doesn't respond_to #change here is because you've using a plugin that overrides the internals of Rails.
Even if we did a respond_to check in this case, what would we do when the class didn't respond_to? You're using a day= setter method, which is an implementation detail of the plugin you're using. No other Time-like classes that I know of respond_to #day=.
I suggest you submit a patch to the validates_timeliness plugin -- should be simple enough to add a #change method.
-
Martijn Vos
I understand. I'll submit a patch there.
