Skip to content

Commit a41ffb1

Browse files
authored
Fix deprecation warning regarding to_time (#2753)
We had a deprecation warning: to_time will always preserve the receive timezone rather than system local time in Rails 8.1 which gets fixed by setting "to_time_preserves_timezone" to "zone" in the application configuration.
1 parent dd74755 commit a41ffb1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spec/example_app/config/application.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Application < Rails::Application
2828

2929
config.action_controller.action_on_unpermitted_parameters = :raise
3030
config.active_record.time_zone_aware_types = %i[datetime time]
31+
config.active_support.to_time_preserves_timezone = :zone
3132

3233
# Opt-out of FLoC: https://amifloced.org/
3334
config.action_dispatch

0 commit comments

Comments
 (0)