Skip to content

ActiveAdmin does not work when permanent_connection_checkout is disallowed (v3 / v4, Rails >= 7.2) #8881

@tagliala

Description

@tagliala

It is when config.active_record.permanent_connection_checkout = :disallowed config is used. Which is a good idea when using fibers, as there can be many more fibers than threads and then dry up the db pool

Try and load the admin users page and see the exception.

Originally posted by @henrikbjorn in #8474 (comment)

Expected behavior

ActiveAdmin works

Actual behavior

ActiveRecord::ActiveRecordError in Admin::CommentsController#index

Called deprecated `ActiveRecord::Base.connection` method.
Either use `with_connection` or `lease_connection`.

How to reproduce

  1. Clone demo.activeadmin.info
  2. Add config.active_record.permanent_connection_checkout = :disallowed to config/application.rb
  3. Go to http://localhost:3000/admin/comments

More information

Old PR addressing this issue #8474

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions