Major FlexTimes update/refactor
Prompted by a bug submitted to the project last night, I've decided to add some major stuff to FlexTimes:
For compatibility, the old AR methods will not go away. I'll be posting this newest update as version 1.5 (tarball). I anticipate version 2.0 will do away with the AR declarations.
- Many options that are normally passed through to the non-instance helpers (
select_xxx) were not being passed, so I'm modifyingdatetime_selectto cleanse theoptionshash and then pass it on to each helper. One example is:start_year. Unfortunately, because of the way the hash parameters will be parsed, I don't think I'll allow:include_blank. - The most common error in using FlexTimes was not having a
datetime_columndeclaration (or one of its sister declarations) in the model. I've decided to alleviate this by overriding ActiveRecord'swrite_attributemethod, rather than futzing with multiparameter attributes. Spawned from this effort were some other refactorings:Hashwill receive two new methods:to_date, andto_time. It only makes sense, since much of what is done in the AR helpers is converting between a hash and a date or time.- Likewise,
DateandTimewill receive ato_hashmethod. QED.
For compatibility, the old AR methods will not go away. I'll be posting this newest update as version 1.5 (tarball). I anticipate version 2.0 will do away with the AR declarations.
