singleton_class.module_eval <<~RUBY, __FILE__, __LINE__ + 1
            def #{method_name}(#{args})
              #{target}.#{method_name}(#{args})
            ensure
              ActiveSupport.deprecator.warn("Calling #{method_name} on ActiveSupport::Deprecation is deprecated and will be removed from Rails (use #{use_instead} instead)")