Skip to content

Commit

Permalink
Ensure ActionView::Digest.cache is correctly cleaned up when
Browse files Browse the repository at this point in the history
ActionView::Resolver.caching = false.
  • Loading branch information
wyaeld committed Oct 14, 2013
1 parent 89969dd commit 2b3a349
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions actionview/lib/action_view/digestor.rb
Expand Up @@ -36,12 +36,12 @@ def compute_and_store_digest(cache_key, name, format, finder, options) # called
end end


# Store the actual digest if config.cache_template_loading is true # Store the actual digest if config.cache_template_loading is true
klass.new(name, format, finder, options).digest.tap do |digest| digest = klass.new(name, format, finder, options).digest
@@cache[cache_key] = digest if ActionView::Resolver.caching? @@cache[cache_key] = digest if ActionView::Resolver.caching?
end digest
rescue Exception ensure
@@cache.delete_pair(cache_key, false) if pre_stored # something went wrong, make sure not to corrupt the @@cache # something went wrong or ActionView::Resolver.caching? is false, make sure not to corrupt the @@cache
raise @@cache.delete_pair(cache_key, false) if pre_stored || !digest
end end
end end


Expand Down

0 comments on commit 2b3a349

Please sign in to comment.