aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-08-27 10:05:01 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-08-27 10:05:01 -0700
commitd6854dfe13ae0b6cd683c69f35635d44954b7cc6 (patch)
tree9d1773fc4e7055d3a87d86b3c13b3c70e09e0f2a /actionview/lib
parent7967fa9251c1c8e6a27d765a1e7cc0a377f97965 (diff)
parent7e74a01f849db3b85ac04ce425461c22b2b191d3 (diff)
downloadrails-d6854dfe13ae0b6cd683c69f35635d44954b7cc6.tar.gz
rails-d6854dfe13ae0b6cd683c69f35635d44954b7cc6.tar.bz2
rails-d6854dfe13ae0b6cd683c69f35635d44954b7cc6.zip
Merge pull request #11768 from cloudspace/cache_template_loading
Only cache template digests if !config.cache_template_loading
Diffstat (limited to 'actionview/lib')
-rw-r--r--actionview/lib/action_view/digestor.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/actionview/lib/action_view/digestor.rb b/actionview/lib/action_view/digestor.rb
index 64239c81b2..95c3200c81 100644
--- a/actionview/lib/action_view/digestor.rb
+++ b/actionview/lib/action_view/digestor.rb
@@ -32,9 +32,13 @@ module ActionView
Digestor
end
- @@cache[cache_key] = digest = klass.new(name, format, finder, options).digest # Store the actual digest
- ensure
- @@cache.delete_pair(cache_key, false) if pre_stored && !digest # something went wrong, make sure not to corrupt the @@cache
+ # Store the actual digest if config.cache_template_loading is true
+ klass.new(name, format, finder, options).digest.tap do |digest|
+ @@cache[cache_key] = digest if ActionView::Resolver.caching?
+ end
+ rescue Exception
+ @@cache.delete_pair(cache_key, false) if pre_stored # something went wrong, make sure not to corrupt the @@cache
+ raise
end
end