Project

General

Profile

Actions

Defect #43231

closed

DEPRECATION WARNING: `to_time` will always preserve the receiver timezone rather than system local time in Rails 8.1

Added by Marius BĂLTEANU 9 months ago. Updated 17 days ago.

Status:
Closed
Priority:
Normal
Category:
Rails support
Target version:
-
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

Blocks Redmine - Feature #43205: Update to Rails 8ClosedMarius BĂLTEANUActions
Actions #1

Updated by Marius BĂLTEANU 9 months ago

Actions #3

Updated by Marius BĂLTEANU 9 months ago

  • Status changed from New to Closed
  • Assignee set to Marius BĂLTEANU
  • Resolution set to Fixed
Actions #4

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 #5

Updated by Marius BĂLTEANU 17 days ago

Thanks, committed.

Actions #6

Updated by Marius BĂLTEANU 17 days ago

  • Status changed from Reopened to Closed
Actions

Also available in: Atom PDF