diff --git a/CHANGELOG.md b/CHANGELOG.md index d96ad3f1c6..1236363ab4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### Unreleased - +* enhancements + * Changed to use a separate deprecator inside the gem. because `rails` 7.1 will deprecate using the singleton `ActiveSupport::Deprecation.instance` (@soartec-lab, @etiennebarrie) ### 4.9.2 - 2023-04-03 diff --git a/lib/devise/rails/deprecated_constant_accessor.rb b/lib/devise/rails/deprecated_constant_accessor.rb index d1eff92f2c..f5cf01f89c 100644 --- a/lib/devise/rails/deprecated_constant_accessor.rb +++ b/lib/devise/rails/deprecated_constant_accessor.rb @@ -26,7 +26,7 @@ def const_missing(missing_const_name) super end - def deprecate_constant(const_name, new_constant, message: nil, deprecator: ActiveSupport::Deprecation.instance) + def deprecate_constant(const_name, new_constant, message: nil, deprecator: Devise.deprecator) class_variable_set(:@@_deprecated_constants, {}) unless class_variable_defined?(:@@_deprecated_constants) class_variable_get(:@@_deprecated_constants)[const_name.to_s] = { new: new_constant, message: message, deprecator: deprecator } end