Skip to content

Commit

Permalink
Fix activerecord 7.1 deprecation warnings (#755)
Browse files Browse the repository at this point in the history
* Fix activerecord 7.1 deprecation warnings

* Backward compatibility with activerecord < 7.1
  • Loading branch information
tomgi authored Dec 5, 2023
1 parent 9b5615e commit 6685016
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/shoryuken/middleware/server/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ class ActiveRecord
def call(*_args)
yield
ensure
::ActiveRecord::Base.clear_active_connections!
if ::ActiveRecord.version >= Gem::Version.new('7.1')
::ActiveRecord::Base.connection_handler.clear_active_connections!(:all)
else
::ActiveRecord::Base.clear_active_connections!
end
end
end
end
Expand Down

0 comments on commit 6685016

Please sign in to comment.