Module ActiveSupport::Deprecation
In: lib/active_support/deprecation.rb
lib/active_support/deprecation/reporting.rb
lib/active_support/deprecation/proxy_wrappers.rb
lib/active_support/deprecation/behaviors.rb

Methods

Constants

DEFAULT_BEHAVIORS = { :stderr => Proc.new { |message, callstack| $stderr.puts(message)   Default warning behaviors per Rails.env.

Attributes

debug  [RW]  Whether to print a backtrace along with the warning.
deprecation_horizon  [RW]  The version the deprecated behavior will be removed, by default.
silenced  [RW] 

Public Class methods

Returns the set behavior or if one isn‘t set, defaults to +:stderr+

Sets the behavior to the specified value. Can be a single value or an array.

Examples

  ActiveSupport::Deprecation.behavior = :stderr
  ActiveSupport::Deprecation.behavior = [:stderr, :log]

Silence deprecation warnings within the block.

Outputs a deprecation warning to the output configured by ActiveSupport::Deprecation.behavior

  ActiveSupport::Deprecation.warn("something broke!")
  # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)"

[Validate]