diff options
Diffstat (limited to 'activemodel/lib/active_model/type/date_time.rb')
-rw-r--r-- | activemodel/lib/active_model/type/date_time.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activemodel/lib/active_model/type/date_time.rb b/activemodel/lib/active_model/type/date_time.rb index b068cfc672..2f2df4320f 100644 --- a/activemodel/lib/active_model/type/date_time.rb +++ b/activemodel/lib/active_model/type/date_time.rb @@ -12,11 +12,11 @@ module ActiveModel private - def cast_value(string) - return string unless string.is_a?(::String) - return if string.empty? + def cast_value(value) + return apply_seconds_precision(value) unless value.is_a?(::String) + return if value.empty? - fast_string_to_time(string) || fallback_string_to_time(string) + fast_string_to_time(value) || fallback_string_to_time(value) end # '0.123456' -> 123456 |