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

Most upvoted comments

A quick and dirty fix would be:

ActiveAdmin.routes(self) unless ARGV.grep(/assets:precompile/).any?