class ActiveSupport::Deprecation

config.active_support.deprecation = :raise
# in config/environments/test.rb
With the above initializer, configuration settings like the following will affect MyLibrary.deprecator:<br><br>end<br>end<br>end<br>app.deprecators = MyLibrary.deprecator
initializer “my_library.deprecator” do |app|
class Railtie < Rails::Railtie
module MyLibrary
configuration can be applied to it.
For a Railtie or Engine, you may also want to add it to the application’s deprecators, so that the application’s
end
end
@deprecator ||= ActiveSupport::Deprecation.new(“2.0”, “MyLibrary”)
def self.deprecator
module MyLibrary
users to be able to configure it).
For a gem, use Deprecation.new to create a Deprecation object and store it in your module or class (in order for
also available for gems or applications.
Deprecation specifies the API used by Rails to deprecate methods, instance variables, objects, and constants. It’s
= Active Support Deprecation

def initialize(deprecation_horizon = "7.2", gem_name = "Rails")

ActiveSupport::Deprecation.new('2.0', 'MyLibrary')

and the second is a library name.
It accepts two parameters on initialization. The first is a version of library
def initialize(deprecation_horizon = "7.2", gem_name = "Rails")
  self.gem_name = gem_name
  self.deprecation_horizon = deprecation_horizon
  # By default, warnings are not silenced and debugging is off.
  self.silenced = false
  self.debug = false
  @silence_counter = Concurrent::ThreadLocalVar.new(0)
  @explicitly_allowed_warnings = Concurrent::ThreadLocalVar.new(nil)
end