don't call to_time on Time object.

Fixes Ruby 1.9 bug which changes the zone to local when calling to_time
on a Time object! Lame! I mean seriously, Rails created the method and
then Ruby copies it into core and changes the behaviour. Why?
This commit is contained in:
Adam Meehan 2010-10-14 07:40:30 +11:00
parent b152dff626
commit 1e48173e6a

View File

@ -11,7 +11,7 @@ module ValidatesTimeliness
when :date
value.to_date
when :datetime
value.to_time
value.is_a?(Time) ? value : value.to_time
end
if options[:ignore_usec] && value.is_a?(Time)
ValidatesTimeliness::Parser.make_time(Array(value).reverse[4..9], @timezone_aware)