Project

General

Profile

Actions

Patch #41141

closed

Replace deprecated `ActiveSupport::Deprecation.warn` with custom deprecation object

Added by Go MAEDA 3 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Category:
Code cleanup/refactoring
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

The usage of ActiveSupport::Deprecation.warn has been deprecated in Rails 7.1 and has been removed in Rails 7.2.
The attached patch fixes the deprecated usage by replacing ActiveSupport::Deprecation with a custom deprecation object.

In Rails 7.1.2, calling ActiveSupport::Deprecation.warn produces the following deprecation warning:

$ bin/rails r 'ActiveSupport::Deprecation.warn("warning!")'
DEPRECATION WARNING: warning! (called from require at bin/rails:4)
DEPRECATION WARNING: Calling warn on ActiveSupport::Deprecation is deprecated and will be removed from Rails (use your own Deprecation object instead) (called from require at bin/rails:4)

In Rails 7.2.0, the method is removed, resulting in an error:

$ bin/rails r 'ActiveSupport::Deprecation.warn("warning!")'
Please specify a valid ruby command or the path of a script to run.
Run 'bin/rails runner -h' for help.

private method `warn' called for class ActiveSupport::Deprecation


Files


Related issues

Related to Redmine - Feature #36320: Migrate to Rails 7.2ClosedMarius BĂLTEANU

Actions
Actions #1

Updated by Marius BĂLTEANU 3 months ago

  • Status changed from New to Closed
  • Assignee set to Marius BĂLTEANU

Fixed in r22961 as part of #36320.

Actions #2

Updated by Marius BĂLTEANU 3 months ago

Actions

Also available in: Atom PDF