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

Encourage #lease_connection over #connection on AR model #inspect without connection #51620

Conversation

joshuay03
Copy link
Contributor

Motivation / Background

Ref: #51349

Seeing as ActiveRecord::Base.connection is soft deprecated, it's probably worth updating this #inspect to encourage the use of one of the suggested alternatives instead.

Detail

Updates #inspect for non-abstract AR model classes to suggest the use of #lease_connection instead of the soft deprecated #connection when the model does not have an established connection.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

@joshuay03 joshuay03 changed the title Encourage #lease_connection over #connection on AR model inspect without connection Encourage #lease_connection over #connection on AR model #inspect without connection Apr 21, 2024
@joshuay03 joshuay03 force-pushed the encourage-lease-connection-on-model-inspect-no-connection branch from e8f5414 to 7861476 Compare April 21, 2024 10:44
Copy link
Contributor

@ioquatix ioquatix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@byroot byroot merged commit edbe467 into rails:main Apr 22, 2024
3 checks passed
@joshuay03 joshuay03 deleted the encourage-lease-connection-on-model-inspect-no-connection branch April 22, 2024 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants