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
Deprecate ConnectionPool#connection
#51230
Conversation
a439e64
to
9f6fa2b
Compare
Replaced by `#lease_connection` to better reflect what it does. `ActiveRecord::Base#connection` is deprecated in the same way but without a removal timeline nor a deprecation warning. Inside the Active Record test suite, we do remove `Base.connection` to ensure it's not used internally. Some callsites have been converted to use `with_connection`, some other have been more simply migrated to `lease_connection` and will serve as a list of callsites to convert for rails#50793
9f6fa2b
to
7263da5
Compare
alias_method :connection, :lease_connection # TODO: deprecate | ||
def connection | ||
ActiveRecord.deprecator.warn(<<~MSG) | ||
ConnectionPoool#connection is deprecated and will be removed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 Thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I wasn't even meaning this. I just noticed that Poool
doesn't look very correct. My bad, should have been more specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I meant to fix that too, but I must be tired 😫
Ref: - rails/rails@7263da5 - rails/rails#51230 Close #275
Ref: - rails/rails@7263da5 - rails/rails#51230 Close #275
Ref: - rails/rails@7263da5 - rails/rails#51230 Close #275
Replaced by
#lease_connection
to better reflect what it does.ActiveRecord::Base.connection
is deprecated in the same way but without a removal timeline nor a deprecation warning.Inside the Active Record test suite, we do remove
Base.connection
to ensure it's not used internally.Some callsites have been converted to use
with_connection
, some other have been more simply migrated tolease_connection
and will serve as a list of callsites to convert for #50793FYI: @matthewd