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

Fix up style

This commit is contained in:
Aaron Patterson 2019-02-19 14:57:29 -08:00
parent 1bc0a59d6e
commit 3f84a814aa
No known key found for this signature in database
GPG key ID: 953170BCB4FFAFC6
4 changed files with 8 additions and 8 deletions

View file

@ -90,12 +90,12 @@ module ActionView
@lookup_context.formats = formats | @lookup_context.formats
end
def build_rendered_template(content, layout, template)
def build_rendered_template(content, template, layout = nil)
RenderedTemplate.new content, layout, template
end
def build_rendered_collection(templates, spacer)
RenderedCollection.new(templates, spacer)
RenderedCollection.new templates, spacer
end
end
end

View file

@ -330,7 +330,7 @@ module ActionView
spacer = if @options.key?(:spacer_template)
spacer_template = find_template(@options[:spacer_template], @locals.keys)
build_rendered_template(spacer_template.render(view, @locals), nil, spacer_template)
build_rendered_template(spacer_template.render(view, @locals), spacer_template)
else
RenderedTemplate::EMPTY_SPACER
end
@ -364,7 +364,7 @@ module ActionView
content = layout.render(view, locals) { content } if layout
payload[:cache_hit] = view.view_renderer.cache_hits[template.virtual_path]
build_rendered_template(content, layout, template)
build_rendered_template(content, template, layout)
end
end
@ -455,7 +455,7 @@ module ActionView
content = template.render(view, locals)
content = layout.render(view, locals) { content } if layout
partial_iteration.iterate!
build_rendered_template(content, layout, template)
build_rendered_template(content, template, layout)
end
end
@ -477,7 +477,7 @@ module ActionView
template = (cache[path] ||= find_template(path, keys + [as, counter, iteration]))
content = template.render(view, locals)
partial_iteration.iterate!
build_rendered_template(content, nil, template)
build_rendered_template(content, template)
end
end

View file

@ -84,7 +84,7 @@ module ActionView
def fetch_or_cache_partial(cached_partials, template, order_by:)
order_by.map do |cache_key|
if content = cached_partials[cache_key]
build_rendered_template(content, nil, template)
build_rendered_template(content, template)
else
yield.tap do |rendered_partial|
collection_cache.write(cache_key, rendered_partial.body)

View file

@ -61,7 +61,7 @@ module ActionView
else
content
end
build_rendered_template(body, layout, template)
build_rendered_template(body, template, layout)
end
# This is the method which actually finds the layout using details in the lookup