mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
Return value if not of known type in type cast
This commit is contained in:
parent
321834b5ff
commit
4e5f5fa695
@ -12,6 +12,8 @@ module ValidatesTimeliness
|
|||||||
value.to_date
|
value.to_date
|
||||||
when :datetime
|
when :datetime
|
||||||
value.is_a?(Time) ? value : value.to_time
|
value.is_a?(Time) ? value : value.to_time
|
||||||
|
else
|
||||||
|
value
|
||||||
end
|
end
|
||||||
if options[:ignore_usec] && value.is_a?(Time)
|
if options[:ignore_usec] && value.is_a?(Time)
|
||||||
Timeliness::Parser.make_time(Array(value).reverse[4..9], (:current if @timezone_aware))
|
Timeliness::Parser.make_time(Array(value).reverse[4..9], (:current if @timezone_aware))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user