DEFAULT_BEHAVIORS | = | { :stderr => Proc.new { |message, callstack| $stderr.puts(message) | Default warning behaviors per Rails.env. |
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] |
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]
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)"