Skip to content

app:update prints deprecation warnings during active_storage:update #53558

@Earlopain

Description

@Earlopain

Steps to reproduce

Have a app on 7.2 with ActiveStore set up, upgrade to 8.0, and run app:update

Expected behavior

No deprecation warnings

Actual behavior

$ bin/rails app:update
...
       rails  active_storage:update
DEPRECATION WARNING: `to_time` will always preserve the full timezone rather than offset of the receiver in Rails 8.1. To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`. (called from <top (required)> at /home/user/code/reverser/config/environment.rb:5)
DEPRECATION WARNING: `to_time` will always preserve the full timezone rather than offset of the receiver in Rails 8.1. To opt in to the new behavior, set `config.active_support.to_time_preserves_timezone = :zone`. (called from <top (required)> at /home/user/code/reverser/config/environment.rb:5)

active_storage:update seems to load the environment, which causes some initializers to run, include the one for assigning to_time_preserves_timezone. There is code to silence warnings:

silence_warnings do
::Rails::Command.invoke(command, args, **options)
end

so I would say that deprecations are unexpected. However I did not easily find a way to silence deprecations in that block. The deprecators are only available after/sometime during the command. Rails.logger is also not yet set up.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions