instance method
silence
Ruby on Rails 6.1.7.10
Since v4.0.13Signature
silence(&block)
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
Parameters
-
blockblock
Source
# File activesupport/lib/active_support/deprecation/reporting.rb, line 40
def silence(&block)
@silenced_thread.bind(true, &block)
end
Defined in activesupport/lib/active_support/deprecation/reporting.rb line 40
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Deprecation::Reporting