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

Rails 7.1: DEPRECATION WARNING: Calling ActiveRecord::Base.clear_active_connections! is deprecated. Please call the method directly on the connection handler; for example: ActiveRecord::Base.connection_handler.clear_active_connections! #205

Open
andreavocado opened this issue Feb 14, 2024 · 1 comment · May be fixed by #208

Comments

@andreavocado
Copy link

Please describe the issue

When running run_rpc method from gruf-rspec under Rails 7.1 the deprecation warning "DEPRECATION WARNING: Calling ActiveRecord::Base.clear_active_connections! is deprecated. Please call the method directly on the connection handler; for example: ActiveRecord::Base.connection_handler.clear_active_connections!" is shown.

This line should be migrated:

target_classes.each(&:clear_active_connections!) if enabled?

How to Reproduce

Steps to reproduce the behavior:

Run any test with run_rpc method from gruf-rspec

What should happen?

The connection is cleared on the connection handler of AR and the deprecation warning is gone.

Anything else we should know?

  • gruf-2.19.0
  • gruf-rspec-1.0.0
  • rails-7.1.2
  • Ruby 3.2.3
@Abdullah-l
Copy link

It appears in logs while using rails 7.1 with gruf in general not just with gruf-rspec

On an unrelated note, @splittingred is it just you maintaining gruf at the moment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants