diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/sprockets/assets.rake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/sprockets/assets.rake b/actionpack/lib/sprockets/assets.rake index bb5cf6740a..7b86d84a27 100644 --- a/actionpack/lib/sprockets/assets.rake +++ b/actionpack/lib/sprockets/assets.rake @@ -54,7 +54,11 @@ namespace :assets do end task :environment do - Rails.application.initialize!(:assets) - Sprockets::Bootstrap.new(Rails.application).run + if Rails.application.config.assets.initialize_on_precompile + Rake::Task["environment"].invoke + else + Rails.application.initialize!(:assets) + Sprockets::Bootstrap.new(Rails.application).run + end end end |