提交 7ea85ff5 编写于 作者: J Jeremy Kemper

Revert "Revert "Name compiled render methods". This caused several failures on...

Revert "Revert "Name compiled render methods". This caused several failures on AP test suite for 1.9.2."

This reverts commit 9013227e.

minitest was 'running' compiled templates beginning with test!
上级 caab1761
......@@ -156,11 +156,12 @@ def counter_name
end
def inspect
if defined?(Rails.root)
identifier.sub("#{Rails.root}/", '')
else
identifier
end
@inspect ||=
if defined?(Rails.root)
identifier.sub("#{Rails.root}/", '')
else
identifier
end
end
private
......@@ -267,9 +268,11 @@ def #{method_name}(local_assigns)
end
def build_method_name(locals)
# TODO: is locals.keys.hash reliably the same?
@method_names[locals.keys.hash] ||=
"_render_template_#{@identifier.hash}_#{__id__}_#{locals.keys.hash}".gsub('-', "_")
@method_names[locals.keys.hash] ||= "_#{identifier_method_name}__#{@identifier.hash}_#{__id__}_#{locals.keys.hash}".gsub('-', "_")
end
def identifier_method_name
@identifier_method_name ||= inspect.gsub(/[^a-z_]/, '_')
end
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册