mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Don't wrap the raise with ensure
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -12,7 +12,7 @@ class TestERBTemplate < ActiveSupport::TestCase
|
||||
def find_template(*args)
|
||||
end
|
||||
|
||||
attr_writer :formats
|
||||
attr_accessor :formats
|
||||
end
|
||||
|
||||
class Context
|
||||
|
||||
Reference in New Issue
Block a user