From 0734e788bd7b27d675a158237b501749f45df2f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 4 Sep 2020 16:50:43 +0200 Subject: [PATCH] Preserve timezone when calling `to_time` Quoting the Rails DateAndTime::Compatibility module: > With Ruby 2.4+ the default for +to_time+ changed from > converting to the local system time, to preserving the offset > of the receiver. For backwards compatibility we're overriding > this behavior We don't need backwards compatibility in our application because we aren't converting any time objects to the local system timezone but use the application timezone all the time instead. --- config/application.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/config/application.rb b/config/application.rb index 6c0b838f7..363e8160e 100644 --- a/config/application.rb +++ b/config/application.rb @@ -11,7 +11,6 @@ module Consul config.load_defaults 5.0 # Overwrite Rails 5.0 defaults and use the options we used in Rails 4 - ActiveSupport.to_time_preserves_timezone = false config.active_record.belongs_to_required_by_default = false config.ssl_options = {}