Module ActiveSupport::Deprecation
In: vendor/rails/activesupport/lib/active_support/deprecation.rb

Methods

Classes and Modules

Module ActiveSupport::Deprecation::Assertions
Module ActiveSupport::Deprecation::ClassMethods
Class ActiveSupport::Deprecation::DeprecatedInstanceVariableProxy

Constants

DEFAULT_BEHAVIORS = { 'test' => Proc.new { |message, callstack| $stderr.puts(message)   Choose the default warn behavior according to RAILS_ENV. Ignore deprecation warnings in production.

Attributes

silenced  [W] 

Public Class methods

[Source]

    # File vendor/rails/activesupport/lib/active_support/deprecation.rb, line 26
26:       def default_behavior
27:         if defined?(RAILS_ENV)
28:           DEFAULT_BEHAVIORS[RAILS_ENV.to_s]
29:         else
30:           DEFAULT_BEHAVIORS['test']
31:         end
32:       end

Silence deprecations for the duration of the provided block. For internal use only.

[Source]

    # File vendor/rails/activesupport/lib/active_support/deprecation.rb, line 42
42:       def silence
43:         old_silenced, @silenced = @silenced, true # We could have done behavior = nil...
44:         yield
45:       ensure
46:         @silenced = old_silenced
47:       end

Have deprecations been silenced?

[Source]

    # File vendor/rails/activesupport/lib/active_support/deprecation.rb, line 35
35:       def silenced?
36:         @silenced = false unless defined?(@silenced)
37:         @silenced
38:       end

[Source]

    # File vendor/rails/activesupport/lib/active_support/deprecation.rb, line 22
22:       def warn(message = nil, callstack = caller)
23:         behavior.call(deprecation_message(callstack, message), callstack) if behavior && !silenced?
24:       end

[Validate]