instance method
silence
Ruby on Rails 4.1.16
Since v4.0.13Signature
silence()
Silence deprecation warnings within the block.
ActiveSupport::Deprecation.warn('something broke!') # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)" ActiveSupport::Deprecation.silence do ActiveSupport::Deprecation.warn('something broke!') end # => nil
Source
# File activesupport/lib/active_support/deprecation/reporting.rb, line 32
def silence
old_silenced, @silenced = @silenced, true
yield
ensure
@silenced = old_silenced
end
Defined in activesupport/lib/active_support/deprecation/reporting.rb line 32
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Deprecation::Reporting