From 75329d800fc51c357b47bef8a90d11ec141c0bcd Mon Sep 17 00:00:00 2001 From: kinduff Date: Thu, 25 May 2023 23:00:27 +0200 Subject: [PATCH 1/2] Removes close_db_connection! deprecation warning Method was deprecated in Rails https://github.com/rails/rails/commit/a93d8fe29440c0791bdd71adb07b617dd8a9b33d --- lib/message_bus/rack/middleware.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/message_bus/rack/middleware.rb b/lib/message_bus/rack/middleware.rb index 618ddf40..d6b77ba5 100644 --- a/lib/message_bus/rack/middleware.rb +++ b/lib/message_bus/rack/middleware.rb @@ -199,7 +199,9 @@ def close_db_connection! # ConnectionManagement in Rails puts a BodyProxy around stuff # this means connections are not returned until rack.async is # closed - if defined? ActiveRecord::Base.clear_active_connections! + if defined? ActiveRecord::Base.connection_handler + ActiveRecord::Base.connection_handler.clear_active_connections! + elsif defined? ActiveRecord::Base.clear_active_connections! ActiveRecord::Base.clear_active_connections! end end From 8a2b99abc11c61ba6f6279f5ab6bf069c684df5f Mon Sep 17 00:00:00 2001 From: kinduff Date: Sat, 12 Aug 2023 12:05:03 +0200 Subject: [PATCH 2/2] Updates CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 202dfcdd..6b4c3e0b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ FUTURE - FIX: Typo in `group_ids_lookup` option name in Redis params exclusion list that was preventing the use of the redis backend along with this option. +- FIX: Removes close_db_connection! deprecation warning. 28-06-2023