修复弃用警告:调用 ActiveRecord::Base.clear_active_connections

问题描述 投票:0回答:1

我正在使用 Active Record 开发 Ruby Sinatra 应用程序,每次 HTTP 调用时它都会在控制台中打印此错误消息。

我找不到有关此弃用或如何修复它的更多信息。

DEPRECATION WARNING: Calling `ActiveRecord::Base.clear_active_connections! is deprecated. Please call the method directly on the connection handler; for example: `ActiveRecord::Base.connection_handler.clear_active_connections!`. (called from clear_active_connections! at /Users/user/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activerecord-7.1.1/lib/active_record/connection_handling.rb:320)
ruby activerecord sinatra sinatra-activerecord
1个回答
0
投票

解决了。只需要更新 gem

© www.soinside.com 2019 - 2024. All rights reserved.