On Jul 23, 2010, at 6:20 PM, storitel wrote:
I had been using the datepicker, but had to drop it because the format
order wasn't always being picked up properly. once i get the agility/
selenium setup running i will try to replicate that...
meantime, i guess this *is* a bug? if it's a problem in rails/
validates_timeliness, it's even more surprising...
Looks like we either need to borrow the Rails fallback code for this,
or figure out how to get out the attribute parsing business entirely.
Here's how Rails avoids the error:
begin
values = values_with_empty_parameters.collect do |
v| v.nil? ? 1 : v end
Date.new(*values)
rescue ArgumentError => ex # if Date.new raises an
exception on an invalid date
instantiate_time_object(name, values).to_date # we
instantiate Time object and convert it back to a date thus using
Time's logic in handling invalid dates
end
I was kind of disappointed when I found this; I was hoping there was a
slightly more glamorous solution than just swallowing the exception
and punting. Apparently not. :)
Tom, Bryan - do either of you recall why we're manually parsing those
attributes in convert_type_for_mass_assignment? Is it still needed in
2.3?
--Matt Jones
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.