Backport PR #8883 to 3-0-stable with Rails < 7.2 conditionals#8965
Backport PR #8883 to 3-0-stable with Rails < 7.2 conditionals#8965tagliala merged 1 commit into3-0-stablefrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 3-0-stable #8965 +/- ##
=============================================
Coverage ? 99.19%
=============================================
Files ? 194
Lines ? 4974
Branches ? 0
=============================================
Hits ? 4934
Misses ? 40
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Rebased the branch with |
7380a16 to
8789991
Compare
There was a problem hiding this comment.
Pull request overview
Backport of upstream connection-handling updates to the 3-0-stable branch while preserving compatibility with Rails versions that don’t yet support the newer connection APIs.
Changes:
- Gate column quoting in
ActiveAdmin::Resource#resource_quoted_column_namebehind awith_connectionfeature check, with fallback toconnection. - Update a unit spec to use
lease_connectionwhen available to avoid direct.connectionusage on newer Rails. - Update the Rails app template used in specs to only set
permanent_connection_checkout = :disallowedon Rails >= 7.2.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
lib/active_admin/resource.rb |
Uses with_connection when available for column-name quoting, falling back for older Rails. |
spec/unit/resource_controller/data_access_spec.rb |
Avoids direct .connection by using lease_connection when present. |
spec/support/rails_template.rb |
Conditionally applies Rails 7.2+ permanent connection checkout restriction in the generated spec app. |
8789991 to
463b123
Compare
Use with_connection/lease_connection when available (Rails >= 7.2), falling back to connection for older Rails versions. Conditionally set permanent_connection_checkout config only for Rails >= 7.2. This enables the backport to work on the 3-0-stable branch which still supports Rails < 7.2. Co-authored-by: tagliala <[email protected]>
463b123 to
8980f1d
Compare
|
@mgrunberg I leave the release to you. Probably this should bump the minor version because of Devise 5, and this can be considered a feature as well |
Backport of #8883 (drop legacy connection support) to
3-0-stable. Since this branch still supports Rails < 7.2, all connection API changes are gated behind version/feature checks.Cherry-pick of
e602ef7applied to3-0-stablewith conflict resolution:lib/active_admin/resource.rb—resource_quoted_column_nameuseswith_connectionwhen available, falls back toconnectionspec/support/rails_template.rb—permanent_connection_checkout = :disallowedonly set whenRails.gem_version >= 7.2.0(usesinject_into_filematching3-0-stablestyle)spec/unit/resource_controller/data_access_spec.rb—lease_connectionwhen available, falls back toconnectionspec/unit/resource_spec.rb— Added test forresource_quoted_column_nameNote: PR base should be changed to
3-0-stable. The branch contains3-0-stablefile content with conditionals.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.