method

silence

Importance_1
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.