aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2011-04-12 22:12:27 -0500
committerJoshua Peek <josh@joshpeek.com>2011-04-12 22:12:27 -0500
commita4518517f77055cea0d9fe552d2df393140679de (patch)
tree570244b1253daf72996e45f324667abcade12a14 /railties/lib/rails/application
parented24595647374885cebc1d43badc174c0991e93a (diff)
downloadrails-a4518517f77055cea0d9fe552d2df393140679de.tar.gz
rails-a4518517f77055cea0d9fe552d2df393140679de.tar.bz2
rails-a4518517f77055cea0d9fe552d2df393140679de.zip
Index sprockets environment if perform caching is enabled
Diffstat (limited to 'railties/lib/rails/application')
-rw-r--r--railties/lib/rails/application/finisher.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb
index be063e5f25..bae464a840 100644
--- a/railties/lib/rails/application/finisher.rb
+++ b/railties/lib/rails/application/finisher.rb
@@ -48,6 +48,12 @@ module Rails
end
end
+ initializer :index_sprockets_environment do |app|
+ if config.assets.enabled && config.action_controller.perform_caching
+ app.assets = app.assets.index
+ end
+ end
+
initializer :build_middleware_stack do
build_middleware_stack
end