Deprecation specifies the API used by Rails to deprecate methods, instance variables, objects and constants.

Constants

DEFAULT_BEHAVIORS = { raise: ->(message, callstack, deprecation_horizon, gem_name) { e = DeprecationException.new(message) e.set_backtrace(callstack.map(&:to_s)) raise e }, stderr: ->(message, callstack, deprecation_horizon, gem_name) { $stderr.puts(message) $stderr.puts callstack.join("\n ") if debug }, log: ->(message, callstack, deprecation_horizon, gem_name) { logger = if defined?(Rails.logger) && Rails.logger Rails.logger else require "active_support/logger" ActiveSupport::Logger.new($stderr) end logger.warn message logger.debug callstack.join("\n ") if debug }, notify: ->(message, callstack, deprecation_horizon, gem_name) { notification_name = "deprecation.#{gem_name.underscore.tr('/', '_')}" ActiveSupport::Notifications.instrument(notification_name, message: message, callstack: callstack, gem_name: gem_name, deprecation_horizon: deprecation_horizon) }, silence: ->(message, callstack, deprecation_horizon, gem_name) {}, }

Attributes

[RW] deprecation_horizon

The version number in which the deprecated behavior will be removed, by default.

Show files where this module is defined (7 files)
Register or log in to add new notes.