Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: Prevent deprecation warning when using Rails 7.1 #359

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
18-02-2025

- Version 4.3.9

- Prevent deprecation warning when using Rails 7.1

14-09-2023

- Version 4.3.8
Expand Down
6 changes: 5 additions & 1 deletion lib/message_bus/rack/middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ def close_db_connection!
# this means connections are not returned until rack.async is
# closed
if defined? ActiveRecord::Base.connection_handler
ActiveRecord::Base.connection_handler.clear_active_connections!
if Gem::Version.new(Rails.version) >= "7.1"
ActiveRecord::Base.connection_handler.clear_active_connections!(:all)
else
ActiveRecord::Base.connection_handler.clear_active_connections!
end
elsif defined? ActiveRecord::Base.clear_active_connections!
ActiveRecord::Base.clear_active_connections!
end
Expand Down
2 changes: 1 addition & 1 deletion lib/message_bus/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module MessageBus
VERSION = "4.3.8"
VERSION = "4.3.9"
end