Return value if not of known type in type cast

This commit is contained in:
Adam Meehan 2016-01-06 22:20:24 +11:00
parent 321834b5ff
commit 4e5f5fa695

View File

@ -12,6 +12,8 @@ module ValidatesTimeliness
value.to_date
when :datetime
value.is_a?(Time) ? value : value.to_time
else
value
end
if options[:ignore_usec] && value.is_a?(Time)
Timeliness::Parser.make_time(Array(value).reverse[4..9], (:current if @timezone_aware))