mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
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:
parent
b152dff626
commit
1e48173e6a
@ -11,7 +11,7 @@ module ValidatesTimeliness
|
|||||||
when :date
|
when :date
|
||||||
value.to_date
|
value.to_date
|
||||||
when :datetime
|
when :datetime
|
||||||
value.to_time
|
value.is_a?(Time) ? value : value.to_time
|
||||||
end
|
end
|
||||||
if options[:ignore_usec] && value.is_a?(Time)
|
if options[:ignore_usec] && value.is_a?(Time)
|
||||||
ValidatesTimeliness::Parser.make_time(Array(value).reverse[4..9], @timezone_aware)
|
ValidatesTimeliness::Parser.make_time(Array(value).reverse[4..9], @timezone_aware)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user