1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

This reverts commit 9013227e00.

minitest was 'running' compiled templates beginning with test!
This commit is contained in:
Jeremy Kemper 2010-06-29 09:21:24 -07:00
parent caab176116
commit 7ea85ff516

View file

@ -156,11 +156,12 @@ module ActionView
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 @@ module ActionView
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