Fix type_cast_value for values which don't respond to to_time or to_date (renatoelias)

This commit is contained in:
Adam Meehan
2010-12-11 09:13:35 +11:00
parent e345b5dc7d
commit 509336e080
2 changed files with 13 additions and 1 deletions

View File

@@ -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