From f92c81213c775250b4063a5f1cd5da3e3922cbc4 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 21 Feb 2012 15:57:24 -0200 Subject: Don't wrap the raise with ensure --- actionpack/lib/action_view/template.rb | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb index 3a944cf1ab..ebb8e5c1a6 100644 --- a/actionpack/lib/action_view/template.rb +++ b/actionpack/lib/action_view/template.rb @@ -160,16 +160,18 @@ module ActionView # virtual path set (true just for inline templates). def refresh(view) raise "A template needs to have a virtual path in order to be refreshed" unless @virtual_path - lookup = view.lookup_context - pieces = @virtual_path.split("/") - name = pieces.pop - partial = !!name.sub!(/^_/, "") - previous_formats, lookup.formats = lookup.formats, @formats - lookup.disable_cache do - lookup.find_template(name, [ pieces.join('/') ], partial, @locals) + begin + lookup = view.lookup_context + pieces = @virtual_path.split("/") + name = pieces.pop + partial = !!name.sub!(/^_/, "") + previous_formats, lookup.formats = lookup.formats, @formats + lookup.disable_cache do + lookup.find_template(name, [ pieces.join('/') ], partial, @locals) + end + ensure + lookup.formats = previous_formats end - ensure - lookup.formats = previous_formats end def inspect -- cgit v1.2.3