diff options
author | Joshua Peek <josh@joshpeek.com> | 2011-04-12 22:12:27 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2011-04-12 22:12:27 -0500 |
commit | a4518517f77055cea0d9fe552d2df393140679de (patch) | |
tree | 570244b1253daf72996e45f324667abcade12a14 /railties/lib | |
parent | ed24595647374885cebc1d43badc174c0991e93a (diff) | |
download | rails-a4518517f77055cea0d9fe552d2df393140679de.tar.gz rails-a4518517f77055cea0d9fe552d2df393140679de.tar.bz2 rails-a4518517f77055cea0d9fe552d2df393140679de.zip |
Index sprockets environment if perform caching is enabled
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/application.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/application/finisher.rb | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb index 66a1f88c61..92f03f06bf 100644 --- a/railties/lib/rails/application.rb +++ b/railties/lib/rails/application.rb @@ -140,6 +140,7 @@ module Rails def assets @assets ||= build_asset_environment end + attr_writer :assets def build_asset_environment return unless config.assets.enabled 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 |