Skip to content

Commit d4baa5f

Browse files
committed
Fix Rails 8.0 warnings 'to_time' behavior by config/application.rb
1 parent a6706c7 commit d4baa5f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

config/application.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@ class Application < Rails::Application
3232

3333
# Fixture paths
3434
config.fixture_paths = [Rails.root.join('spec/fixtures')]
35+
36+
# Rails 8.0: `to_time` will always preserve the full timezone in Rails 8.1.
37+
config.active_support.to_time_preserves_timezone = :zone
3538
end
3639
end

config/initializers/new_framework_defaults.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
1616
# Previous versions had false.
17-
ActiveSupport.to_time_preserves_timezone = true
17+
#ActiveSupport.to_time_preserves_timezone = true
1818

1919
# Require `belongs_to` associations by default. Previous versions had false.
2020
Rails.application.config.active_record.belongs_to_required_by_default = false

0 commit comments

Comments
 (0)