activeadmin: Do not load database when loading ActiveAdmin
I am in a case when I am trying to deploy a Rails 4 to Heroku. I’m on the Rails4 branch. In compiling the slug, the app compiles the slug without access to things such as the DB.
However, when calling:
# config/routes.rb
ActiveAdmin.routes(self)
It then opens app/admin/#{model}.rb
which attempts to connect to the DB. Which should fail.
On Heroku, this will cause the compilation to fail and the push to be rejected. It has been touched here (somewhere?) and in rails/rails#3410
About this issue
- Original URL
- State: closed
- Created 11 years ago
- Comments: 53 (25 by maintainers)
Commits related to this issue
- lazy-load the sort order to prevent hitting the DB in rake tasks resolves #2342 — committed to activeadmin/activeadmin by seanlinsley 11 years ago
A quick and dirty fix would be: