aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2010-06-29 09:21:24 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2010-06-29 09:22:53 -0700
commit7ea85ff516df142b60126e2dcc1174fd0b8f85a9 (patch)
treeee58b74ed817d9ae4c2a75bf3b3304a992a9407f
parentcaab17611668ff18a3c8642b2d45b353be5d9691 (diff)
downloadrails-7ea85ff516df142b60126e2dcc1174fd0b8f85a9.tar.gz
rails-7ea85ff516df142b60126e2dcc1174fd0b8f85a9.tar.bz2
rails-7ea85ff516df142b60126e2dcc1174fd0b8f85a9.zip
Revert "Revert "Name compiled render methods". This caused several failures on AP test suite for 1.9.2."
This reverts commit 9013227e00895ac95f29077229ec2fb156f450b0. minitest was 'running' compiled templates beginning with test!
-rw-r--r--actionpack/lib/action_view/template.rb19
1 files changed, 11 insertions, 8 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index c00557209b..40ff1f2182 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -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