Skip to content

Commit b88ffab

Browse files
committed
avoid deprecation warning "to_time will always preserve the full timezone rather than offset of the receiver in Rails 8.1."
Configure Rails to use full timezone preservation instead of offset, adopting the upcoming Rails 8.1 default behavior early.
1 parent 5916e01 commit b88ffab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

config/application.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class Application < Rails::Application
2020
#
2121
# These settings can be overridden in specific environments using the files
2222
# in config/environments, which are processed later.
23-
#
23+
24+
config.active_support.to_time_preserves_timezone = :zone
2425
# config.time_zone = "Central Time (US & Canada)"
2526
# config.eager_load_paths << Rails.root.join("extras")
2627
end

0 commit comments

Comments
 (0)