To which initializer file should I add the desired line of code? I'm getting the following deprecation warning.
DEPRECATION WARNING: Time columns will become time zone aware in Rails 5.1. This still causes String
s to be parsed as if they were in Time.zone
,
and Time
s to be converted to Time.zone
.
To keep the old behavior, you must add the following to your initializer:
config.active_record.time_zone_aware_types = [:datetime]
To silence this deprecation warning, add the following:
config.active_record.time_zone_aware_types = [:datetime, :time]
I'm a rails newbie, I just want to follow best practice. Thanks!
add to config/application.rb
inside class Application < Rails::Application
this line:
config.active_record.time_zone_aware_types = [:datetime, :time]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With