Skip to content

Commit

Permalink
Fix deprecation warning regarding to_time
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slickepinne committed Jan 10, 2025
1 parent be806f7 commit 0bbec63
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spec/example_app/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Application < Rails::Application

config.action_controller.action_on_unpermitted_parameters = :raise
config.active_record.time_zone_aware_types = %i[datetime time]
config.active_support.to_time_preserves_timezone = :zone

# Opt-out of FLoC: https://amifloced.org/
config.action_dispatch
Expand Down

0 comments on commit 0bbec63

Please sign in to comment.