mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 07:16:41 +00:00
Fix type_cast_value for values which don't respond to to_time or to_date (renatoelias)
This commit is contained in:
@@ -2,7 +2,7 @@ module ValidatesTimeliness
|
||||
module Conversion
|
||||
|
||||
def type_cast_value(value, type)
|
||||
return nil if value.nil?
|
||||
return nil if value.nil? || !value.respond_to?(:to_time)
|
||||
|
||||
value = value.in_time_zone if value.acts_like?(:time) && @timezone_aware
|
||||
value = case type
|
||||
|
||||
Reference in New Issue
Block a user