diff options
author | Arthur Nogueira Neves <github@arthurnn.com> | 2016-11-03 12:19:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-03 12:19:01 -0400 |
commit | 264566a1b56de4abace2444dff4c9535744855f0 (patch) | |
tree | 4f894a268fc7b9374a4cb8438afcf4b06babf126 /activerecord/lib/active_record/attribute_methods | |
parent | 032ab94332fd5496c5af627bc36445cea3ba476a (diff) | |
parent | 9bf4583241e189d04a5df143332107ef18857034 (diff) | |
download | rails-264566a1b56de4abace2444dff4c9535744855f0.tar.gz rails-264566a1b56de4abace2444dff4c9535744855f0.tar.bz2 rails-264566a1b56de4abace2444dff4c9535744855f0.zip |
Merge pull request #24202 from Sen-Zhang/fix_datetime_error
fix datatime error
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r-- | activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb index ce9985e2e1..500d903857 100644 --- a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb +++ b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb @@ -39,7 +39,7 @@ module ActiveRecord end def set_time_zone_without_conversion(value) - ::Time.zone.local_to_utc(value).in_time_zone if value + ::Time.zone.local_to_utc(value).try(:in_time_zone) if value end def map_avoiding_infinite_recursion(value) |