mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-23 06:16:44 +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
|
||||
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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user