DEFAULT_BEHAVIORS : { raise: ->(message, callstack) { e = DeprecationException.new(message) e.set_backtrace(callstack) raise e }, stderr: ->(message, callstack) { $stderr.puts(message) $stderr.puts callstack.join("\n ") if debug }, log: ->(message, callstack) { logger = if defined?(Rails) && 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) { ActiveSupport::Notifications.instrument("deprecation.rails", :message => message, :callstack => callstack) }, silence: ->(message, callstack) {}, }
Default warning behaviors per Rails.env.
Deprecation specifies the API used by Rails to deprecate methods, instance variables, objects and constants.