Skip to content

Avoid using lease_connection#93

Merged
charkost merged 1 commit into
charkost:mainfrom
joshuay03:avoid-using-lease-connection
Sep 19, 2025
Merged

Avoid using lease_connection#93
charkost merged 1 commit into
charkost:mainfrom
joshuay03:avoid-using-lease-connection

Conversation

@joshuay03
Copy link
Copy Markdown
Contributor

Follow-up to d1eade0

Ideally, using ActiveRecord::ConnectionHandling#lease_connection usage should be avoided unless absolutely needed:

IMO calling .lease_connection in a place other than a script or rake task is a bug and should be reported to whatever gem does it.

We don't really need a connection here since we just need to figure out the adapter, which we can grab from ActiveRecord::DatabaseConfigurations::HashConfig#adapter which is already down-cased.

@joshuay03 joshuay03 moved this to In Progress / Pending Review in Open Source Jul 10, 2025
@joshuay03
Copy link
Copy Markdown
Contributor Author

While I'm here, I recommend expanding your CI matrix to include all Rails versions you're willing to explicitly support, as well as other adapters (at least trilogy and postgresql). FWIW I ran tests locally with postgresql and all but one passed.

@charkost charkost merged commit 87ab560 into charkost:main Sep 19, 2025
3 checks passed
@charkost
Copy link
Copy Markdown
Owner

Thanks @joshuay03 !

@joshuay03 joshuay03 moved this from In Progress / Pending Review to Done in Open Source Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants