instance method
silence
Ruby on Rails 8.1.2
Since v4.0.13Signature
silence(&block)
Silence deprecation warnings within the block.
deprecator = ActiveSupport::Deprecation.new deprecator.warn('something broke!') # => "DEPRECATION WARNING: something broke! (called from your_code.rb:1)" deprecator.silence do deprecator.warn('something broke!') end # => nil
Parameters
-
blockblock
Source
# File activesupport/lib/active_support/deprecation/reporting.rb, line 41
def silence(&block)
begin_silence
block.call
ensure
end_silence
end
Defined in activesupport/lib/active_support/deprecation/reporting.rb line 41
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Deprecation::Reporting