Permalink
Browse files

Avoid loading routes if we are actually precompiling assets.

  • Loading branch information...
1 parent e4902af commit f19955705fe2e988d917834e5eb77117d2851b44 @josevalim josevalim committed Sep 22, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/devise/rails.rb
View
@@ -11,7 +11,7 @@ class Engine < ::Rails::Engine
end
# Force routes to be loaded if we are doing any eager load.
- config.before_eager_load { |app| app.reload_routes! }
+ config.before_eager_load { |app| app.reload_routes! unless ENV["RAILS_ASSETS_PRECOMPILE"] }
initializer "devise.url_helpers" do
Devise.include_helpers(Devise::Controllers)

4 comments on commit f199557

Why would ENV be RAILS_ASSETS_PRECOMPILE? Shouldn't it be production or staging?

@dodeja, ENV["RAILS_ASSETS_PRECOMPILE"] isn't querying the Rails environment, you get that from Rails.env.
This is giving us a way to skip the routes just for the rake task with shell variables. i.e. So you can run RAILS_ASSETS_PRECOMPILE=true rake assets:precompile

How does one set RAILS_ASSETS_PRECOMPILE during just the asset:precompile task?

Owner

josevalim replied Nov 1, 2011

Please sign in to comment.