Skip to content

Commit

Permalink
Revert "Revert "Name compiled render methods". This caused several fa…
Browse files Browse the repository at this point in the history
…ilures on AP test suite for 1.9.2."

This reverts commit 9013227.

minitest was 'running' compiled templates beginning with test!
  • Loading branch information
jeremy committed Jun 29, 2010
1 parent caab176 commit 7ea85ff
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions actionpack/lib/action_view/template.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -156,11 +156,12 @@ def counter_name
end end


def inspect def inspect
if defined?(Rails.root) @inspect ||=
identifier.sub("#{Rails.root}/", '') if defined?(Rails.root)
else identifier.sub("#{Rails.root}/", '')
identifier else
end identifier
end
end end


private private
Expand Down Expand Up @@ -267,9 +268,11 @@ def #{method_name}(local_assigns)
end end


def build_method_name(locals) def build_method_name(locals)
# TODO: is locals.keys.hash reliably the same? @method_names[locals.keys.hash] ||= "_#{identifier_method_name}__#{@identifier.hash}_#{__id__}_#{locals.keys.hash}".gsub('-', "_")
@method_names[locals.keys.hash] ||= end
"_render_template_#{@identifier.hash}_#{__id__}_#{locals.keys.hash}".gsub('-', "_")
def identifier_method_name
@identifier_method_name ||= inspect.gsub(/[^a-z_]/, '_')
end end
end end
end end

0 comments on commit 7ea85ff

Please sign in to comment.