bigcommerce / gruf

gRPC Ruby Framework
https://github.com/bigcommerce/gruf
MIT License
626 stars 73 forks source link

Fix rails `clear_active_connections!` deprecation warning #208

Closed Abdullah-l closed 3 months ago

Abdullah-l commented 8 months ago

What? Why?

Fixes #205

How was it tested?

Existing specs

jlambert121 commented 3 months ago

It'd be great to get this merged and released, anything I can do to help?

Abdullah-l commented 3 months ago

@splittingred Can we get this PR reviewed? 🙏

splittingred commented 3 months ago

@Abdullah-l can you confirm this works on:

This PR has some assumptions right now that connection_handler is going to exist, and do what we want. I think we're going to want proof it's interoperable with those versions of AR in those runtime environments.

Abdullah-l commented 3 months ago

@Abdullah-l can you confirm this works on:

  • Rails 6.1
  • Rails 7.0
  • Rails 7.1
  • A non-rails system using ActiveRecord?

This PR has some assumptions right now that connection_handler is going to exist, and do what we want. I think we're going to want proof it's interoperable with those versions of AR in those runtime environments.

The proof is in active_record source code. connection_handler has always been available, so this change is compatible with any active_record version. The deprecation warning comes for this PR.