diff options
author | Brad Murray <wyaeld@gmail.com> | 2013-10-15 11:17:11 +1300 |
---|---|---|
committer | Brad Murray <wyaeld@gmail.com> | 2013-10-15 11:17:11 +1300 |
commit | 2b3a349123b3f09627bd3f4091e5b885ded0fbac (patch) | |
tree | 0b883beac8a5f5cd2656c339db499a7e8782d0a3 /actionview/lib | |
parent | 89969dd7116cc433382f3f796f33fad3f6d461be (diff) | |
download | rails-2b3a349123b3f09627bd3f4091e5b885ded0fbac.tar.gz rails-2b3a349123b3f09627bd3f4091e5b885ded0fbac.tar.bz2 rails-2b3a349123b3f09627bd3f4091e5b885ded0fbac.zip |
Ensure ActionView::Digest.cache is correctly cleaned up when
ActionView::Resolver.caching = false.
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/digestor.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/actionview/lib/action_view/digestor.rb b/actionview/lib/action_view/digestor.rb index af158a630b..dc353b04ea 100644 --- a/actionview/lib/action_view/digestor.rb +++ b/actionview/lib/action_view/digestor.rb @@ -36,12 +36,12 @@ module ActionView end # 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 + digest = klass.new(name, format, finder, options).digest + @@cache[cache_key] = digest if ActionView::Resolver.caching? + digest + ensure + # something went wrong or ActionView::Resolver.caching? is false, make sure not to corrupt the @@cache + @@cache.delete_pair(cache_key, false) if pre_stored || !digest end end |