Skip to content

Commit df15dbe

Browse files
authored
Removes close_db_connection! deprecation warning (#334)
Method was deprecated in Rails rails/rails@a93d8fe
1 parent 67163f5 commit df15dbe

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FUTURE
22

33
- 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.
4+
- FIX: Removes close_db_connection! deprecation warning.
45

56
28-06-2023
67

lib/message_bus/rack/middleware.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ def close_db_connection!
199199
# ConnectionManagement in Rails puts a BodyProxy around stuff
200200
# this means connections are not returned until rack.async is
201201
# closed
202-
if defined? ActiveRecord::Base.clear_active_connections!
202+
if defined? ActiveRecord::Base.connection_handler
203+
ActiveRecord::Base.connection_handler.clear_active_connections!
204+
elsif defined? ActiveRecord::Base.clear_active_connections!
203205
ActiveRecord::Base.clear_active_connections!
204206
end
205207
end

0 commit comments

Comments
 (0)