Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't wrap the raise with ensure

  • Loading branch information...
commit d37a7e629834c5a83eef38cb09ba12433d30c802 1 parent 12e2405
@spastorino spastorino authored
View
20 actionpack/lib/action_view/template.rb
@@ -159,16 +159,18 @@ def mime_type
# 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
View
2  actionpack/test/template/template_test.rb
@@ -12,7 +12,7 @@ def disable_cache
def find_template(*args)
end
- attr_writer :formats
+ attr_accessor :formats
end
class Context
Please sign in to comment.
Something went wrong with that request. Please try again.