diff --git a/lib/validates_timeliness/converter.rb b/lib/validates_timeliness/converter.rb index 3b84ec9..4317ee1 100644 --- a/lib/validates_timeliness/converter.rb +++ b/lib/validates_timeliness/converter.rb @@ -10,7 +10,7 @@ def initialize(type:, format: nil, ignore_usec: false, time_zone_aware: false) end def type_cast_value(value) - return nil if value.nil? || !value.respond_to?(:to_time) + return nil if value.nil? || !value.respond_to?(:to_time) || value.is_a?(Numeric) value = value.in_time_zone if value.acts_like?(:time) && time_zone_aware? value = case type