Module | ActiveSupport::Deprecation |
In: |
vendor/rails/activesupport/lib/active_support/deprecation.rb
|
DEFAULT_BEHAVIORS | = | { 'test' => Proc.new { |message, callstack| $stderr.puts(message) | Choose the default warn behavior according to RAILS_ENV. Ignore deprecation warnings in production. |
silenced | [W] |
# 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.
# 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?
# File vendor/rails/activesupport/lib/active_support/deprecation.rb, line 35 35: def silenced? 36: @silenced = false unless defined?(@silenced) 37: @silenced 38: end