Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法逐行抑制弃用警告?我正在开发一个旧应用程序,该应用程序有一个导致弃用警告的插件。我宁愿不手动更改该插件的代码。但我可以将其更改为不显示警告。
我的测试看起来像垃圾,带有所有这些警告。
讨厌回答我自己的问题,但这似乎可以解决问题:
ActiveSupport::Deprecation.silence do # no warnings for any use of deprecated methods here end