Skip to content

Replace use of ActiveRecord::Base.connection with with_connection - #652

Merged
rosa merged 1 commit into
mainfrom
permanent_connection_checkout-disallowed
Oct 8, 2025
Merged

Replace use of ActiveRecord::Base.connection with with_connection#652
rosa merged 1 commit into
mainfrom
permanent_connection_checkout-disallowed

Conversation

@rosa

@rosa rosa commented Oct 8, 2025

Copy link
Copy Markdown
Member

So that when running with permanent_connection_checkout set to false, this doesn't cause any problems. Using connection is deprecated in any case, so this was needed regardless.

Fixes #646

So that when running with `permanent_connection_checkout` set to
`false`, this doesn't cause any problems. Using `connection` is
deprecated in any case, so this was needed regardless.
@rosa
rosa merged commit 5c4f452 into main Oct 8, 2025
128 of 129 checks passed
@rosa
rosa deleted the permanent_connection_checkout-disallowed branch October 8, 2025 20:06
@ioquatix

ioquatix commented Oct 8, 2025

Copy link
Copy Markdown

Awesome, thanks!

rosa pushed a commit that referenced this pull request Jul 27, 2026
…nnection`

Bare `connection` resolves to the deprecated ActiveRecord::Base.connection,
which raises under permanent_connection_checkout = :disallowed on Rails 8.1.
Follows the connection_pool.with_connection pattern from #652.
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.

Avoid using bare connection.

2 participants