method

silence

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: Reporting
silence(&block) public

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
Show source
Register or log in to add new notes.