rails/rails — Issue #3410: rake assets:precompile loads routes: option to disable?
Author: benatkin
Created: 2011-10-23 04:48:23+00:00
State: open

There's an [issue on ActiveAdmin](https://github.com/gregbell/active_admin/issues/474) that I and others had where `rake assets:precompile` was failing on Heroku because Heroku runs it in production without access to a production database. It happens because when the command to add the ActiveAdmin routes is run, ActiveAdmin tries to connect to the database. Setting `initialize_on_precompile` to false doesn't fix it; it still loads the routes.

Is there a good reason to load the routes when `rake assets:precompile` is run? If so, how about an option to disable it?

My example is at the bottom of the ActiveAdmin ticket.

I realize that both ActiveAdmin and Heroku can work around this issue but I'd like for rails to consider preventing it too. To me rails handling with either a behavior change or an option would be a more elegant solution.