-
Notifications
You must be signed in to change notification settings - Fork 188
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
Fix activerecord 7.1 and 7.2 deprecations #423
Fix activerecord 7.1 and 7.2 deprecations #423
Conversation
This one would be nice to get merged |
💯 |
@ZimbiX can we get this one in too please? |
Cherry pick PR que-rb#423
Do you have any updates on this? It currently blocks us from upgrading to Rails 7.2.x |
FYI rails 7.2 seems to be working for us with this change to
|
👍🏽 💯 |
Would it help to add Rails 7.2 to the test matrix to give more confidence that this does work correctly with Rails 7.2? |
@tomgi can you clean up the commits for this PR? There is a WIP and two merge commits which shouldn't be there. |
@oeoeaio I want these commits to be here 🙂 They can be all squashed into a single commit when merging this PR to master to keep the master branch linear and clean, but I think it makes sense to have them as-is in this PR. |
@tomgi I'm not sure I follow your logic. As a reviewer, I want to be able to follow your development of a change to fix an issue or add a new feature. That becomes very difficult if I can't understand what each commit is doing. You've got six commits here, that really should just be one or maybe two. I can see from #432 that there is an issue, you don't need to prove that here as well. |
6b21a6c
to
328843a
Compare
@oeoeaio I see your point, I cleaned the WIP commit. But I also think it's important to show that the Rails 7.2 tests are failing on master and passing on this branch. |
328843a
to
a59fe7f
Compare
@oeoeaio thanks, done |
a59fe7f
to
c4dead8
Compare
Similar to #407, but fixes 2 related deprecation warnings and adds backward-compatibility with older version of rails.
On rails 7.1 these are deprecation warnings.
On rails 7.2 the second one is not a warning anymore but a crash with
undefined method clear_active_connections!'
Fixes the following:
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!`. (called from call at /app/.bundle/ruby/3.2.0/bundler/gems/shoryuken-869fb0c77f8e/lib/shoryuken/middleware/server/active_record.rb:8)DEPRECATION WARNING:
clear_active_connections!
currently only applies to connection pools in the current role (writing
). In Rails 7.2, this method will apply to all known pools, regardless of role. To affect only those connections belonging to a specific role, pass the role name as an argument. To switch to the new behavior, pass:all
as the role name. (called from call at /app/.bundle/ruby/3.2.0/bundler/gems/shoryuken-869fb0c77f8e/lib/shoryuken/middleware/server/active_record.rb:8)