aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2012-02-21 15:57:24 -0200
committerSantiago Pastorino <santiago@wyeworks.com>2012-02-21 15:58:25 -0200
commitf92c81213c775250b4063a5f1cd5da3e3922cbc4 (patch)
tree96cbda77c58fbd8723db5c6ac508aced064e1b4e /actionpack/lib
parentd70ed102c881c5b7404f2bf43aa0e268ade1b991 (diff)
downloadrails-f92c81213c775250b4063a5f1cd5da3e3922cbc4.tar.gz
rails-f92c81213c775250b4063a5f1cd5da3e3922cbc4.tar.bz2
rails-f92c81213c775250b4063a5f1cd5da3e3922cbc4.zip
Don't wrap the raise with ensure
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/template.rb20
1 files changed, 11 insertions, 9 deletions
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