From ac1fc5c59499db8d3e875bbd76e0b7c2c9240089 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Sun, 2 Oct 2011 12:33:14 -0700 Subject: [PATCH] rewords the docs of config.assets.initialize_on_precompile in the asset pipeline guide --- railties/guides/source/asset_pipeline.textile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/railties/guides/source/asset_pipeline.textile b/railties/guides/source/asset_pipeline.textile index da0ffb80d2..7795b297f3 100644 --- a/railties/guides/source/asset_pipeline.textile +++ b/railties/guides/source/asset_pipeline.textile @@ -346,12 +346,14 @@ The rake task is: bundle exec rake assets:precompile -Asset templates in general have access to application objects. You may prevent application -initialization in precompilation setting +config.assets.initialize_on_precompile+ to false. +For faster asset precompiles, you can partially load your application by setting ++config.assets.initialize_on_precompile+ to false, though in that case templates +cannot see application objects or methods. *Heroku requires this to be false.* -WARNING: Application objects may still be in scope in asset templates in develoment mode. -If +config.assets.initialize_on_precompile+ is set to false it is your responsability not -to use them at all. +WARNING: If you set +config.assets.initialize_on_precompile+ to false, be sure to +test +rake assets:precompile+ locally before deploying. It may expose bugs where +your assets reference application objects or methods, since those are still +in scope in development mode regardless of the value of this flag. Capistrano (v2.8.0 and above) has a recipe to handle this in deployment. Add the following line to +Capfile+: