aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-12-13 12:13:22 +0900
committerAaron Patterson <aaron.patterson@gmail.com>2015-12-13 12:13:22 +0900
commit2de7385cef62ad12cef5bcfe1de18c4662072344 (patch)
tree081babb3eb7a42155a0da5867ee6bc0f28a040d5 /activemodel
parentcd355a8eeb676d172a1b9fa9855cb2531bd1b4e5 (diff)
parent87ee4f41490665602873d69a2d6bbfc9db049938 (diff)
downloadrails-2de7385cef62ad12cef5bcfe1de18c4662072344.tar.gz
rails-2de7385cef62ad12cef5bcfe1de18c4662072344.tar.bz2
rails-2de7385cef62ad12cef5bcfe1de18c4662072344.zip
Merge pull request #22381 from yahonda/use_adapter_subsecond_precision_supported
Use adapter supports_datetime_with_precision
Diffstat (limited to 'activemodel')
-rw-r--r--activemodel/lib/active_model/type/time.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/type/time.rb b/activemodel/lib/active_model/type/time.rb
index 7101bad566..fe09f63a87 100644
--- a/activemodel/lib/active_model/type/time.rb
+++ b/activemodel/lib/active_model/type/time.rb
@@ -29,7 +29,11 @@ module ActiveModel
return value unless value.is_a?(::String)
return if value.empty?
- dummy_time_value = "2000-01-01 #{value}"
+ if value =~ /^2000-01-01/
+ dummy_time_value = value
+ else
+ dummy_time_value = "2000-01-01 #{value}"
+ end
fast_string_to_time(dummy_time_value) || begin
time_hash = ::Date._parse(dummy_time_value)