method

deprecate_constant

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: DeprecatedConstantAccessor
deprecate_constant(const_name, new_constant, message: nil, deprecator: nil) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/deprecation/constant_accessor.rb, line 42
          def deprecate_constant(const_name, new_constant, message: nil, deprecator: nil)
            ActiveSupport.deprecator.warn("DeprecatedConstantAccessor.deprecate_constant without a deprecator is deprecated") unless deprecator
            deprecator ||= ActiveSupport::Deprecation._instance
            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
Register or log in to add new notes.