aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods
diff options
context:
space:
mode:
authorGenadi Samokovarov <gsamokovarov@gmail.com>2016-03-24 17:35:39 +0200
committerGenadi Samokovarov <gsamokovarov@gmail.com>2016-03-24 17:41:56 +0200
commit05244fa7d79fb84a1a6e3f6948ad389157fb64e1 (patch)
tree17b7a1c1f5724319ea49b51cd39414295e55e81e /activerecord/lib/active_record/attribute_methods
parent00a0388adcb2a09cb811ee9659636a154c36bca5 (diff)
downloadrails-05244fa7d79fb84a1a6e3f6948ad389157fb64e1.tar.gz
rails-05244fa7d79fb84a1a6e3f6948ad389157fb64e1.tar.bz2
rails-05244fa7d79fb84a1a6e3f6948ad389157fb64e1.zip
Fix a tip in Active Record time attributes deprecation
I have hit this deprecation in a newly created Rails 5 application and the suggested tip lead me to a `NoMethodError`. It's not trivial to actually make the following work, because of the ActiveRecord::Base class attributes setting dance in the Active Record railtie. config.active_record.time_zone_aware_types << :time Decided to suggest setting it explicitly to the values we need. [ci skip]
Diffstat (limited to 'activerecord/lib/active_record/attribute_methods')
-rw-r--r--activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb2
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 ebaaa54b2b..e160460286 100644
--- a/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
+++ b/activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
@@ -104,7 +104,7 @@ module ActiveRecord
To silence this deprecation warning, add the following:
- config.active_record.time_zone_aware_types << :time
+ config.active_record.time_zone_aware_types = [:datetime, :time]
MESSAGE
end