Actions
Defect #43231
closedDEPRECATION WARNING: `to_time` will always preserve the receiver timezone rather than system local time in Rails 8.1
Resolution:
Fixed
Affected version:
Description
DEPRECATION WARNING: `to_time` will always preserve the receiver timezone rather than system local time in Rails 8.1.To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`. (called from time_tag at /work/app/helpers/application_helper.rb:754)
Related issues
Updated by Marius BĂLTEANU 9 months ago
- Blocks Feature #43205: Update to Rails 8 added
Updated by Marius BĂLTEANU 9 months ago
https://guides.rubyonrails.org/configuring.html#config-active-support-to-time-preserves-timezone
Setting the default value passes all the tests.
Updated by Marius BĂLTEANU 9 months ago
- Status changed from New to Closed
- Assignee set to Marius BĂLTEANU
- Resolution set to Fixed
Updated by Go MAEDA 17 days ago
- Status changed from Closed to Reopened
The setting introduced in r24052 as part of the Rails 8.0 migration now triggers the following deprecation warning with Rails 8.1:
DEPRECATION WARNING: `config.active_support.to_time_preserves_timezone` is deprecated and will be removed in Rails 8.2
The warning can be fixed by removing the setting added in r24052.
diff --git a/config/application.rb b/config/application.rb
index 96b8ad3f4..51c479b89 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -32,7 +32,6 @@ module RedmineApp
config.active_support.remove_deprecated_time_with_zone_name = true
config.active_support.cache_format_version = 7.0
- config.active_support.to_time_preserves_timezone = :zone
config.active_record.store_full_sti_class = true
config.active_record.default_timezone = :local
Actions