From 6fc518e2ec59ec00076aaca08b9e3df3baee54a3 Mon Sep 17 00:00:00 2001 From: Guillermo Iguaran Date: Tue, 6 Sep 2011 09:24:22 -0500 Subject: [PATCH] config.action_controller.perform_caching isn't used anymore in assets pipeline, instead we are using config.assets.digest now --- actionpack/lib/sprockets/railtie.rb | 2 +- railties/test/application/assets_test.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb index 7927b7bc2c..dc991636a1 100644 --- a/actionpack/lib/sprockets/railtie.rb +++ b/actionpack/lib/sprockets/railtie.rb @@ -71,7 +71,7 @@ module Sprockets mount app.assets => config.assets.prefix end - if config.action_controller.perform_caching + if config.assets.digest app.assets = app.assets.index end end diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index 3c7d178d37..8a5cafe71b 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -64,6 +64,15 @@ module ApplicationTests end end + test "asset pipeline should use a Sprockets::Index when config.assets.digest is true" do + app_file "config/initializers/digest.rb", "Rails.application.config.assets.digest = true" + app_file "config/initializers/caching.rb", "Rails.application.config.action_controller.perform_caching = false" + ENV["RAILS_ENV"] = "production" + require "#{app_path}/config/environment" + + assert_equal Sprockets::Index, Rails.application.assets.class + end + test "precompile creates a manifest file with all the assets listed" do app_file "app/assets/stylesheets/application.css.erb", "<%= asset_path('rails.png') %>" app_file "app/assets/javascripts/application.js", "alert();"