mirror of https://github.com/rails/rails
Name compiled render methods
This commit is contained in:
parent
198ec03f52
commit
2c4f8aae5c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue