Permalink
Browse files

add a new local variable to track if digests are being stored, to ens…

…ure the cleanup works correctly
  • Loading branch information...
1 parent af1dc7f commit 0cdce7f910708005acd99c80463e9efb3df942b0 @wyaeld wyaeld committed Oct 16, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionview/lib/action_view/digestor.rb
@@ -37,11 +37,11 @@ def compute_and_store_digest(cache_key, name, format, finder, options) # called
digest = klass.new(name, format, finder, options).digest
# Store the actual digest if config.cache_template_loading is true
- @@cache[cache_key] = digest if ActionView::Resolver.caching?
+ @@cache[cache_key] = stored_digest = 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
+ @@cache.delete_pair(cache_key, false) if pre_stored && !stored_digest
end
end

0 comments on commit 0cdce7f

Please sign in to comment.