Update streaming_template_renderer.rb

Remove extra `layout_name` check. At that point in the time layout_time will be defined so there's no need to check for it once again.
This commit is contained in:
Ricardo Trindade 2023-07-04 15:21:51 +02:00 committed by GitHub
parent c388a4dcf5
commit adf80fe807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -46,7 +46,7 @@ def render_template(view, template, layout_name = nil, locals = {}) # :nodoc:
return [super.body] unless layout_name && template.supports_streaming?
locals ||= {}
layout = layout_name && find_layout(layout_name, locals.keys, [formats.first])
layout = find_layout(layout_name, locals.keys, [formats.first])
Body.new do |buffer|
delayed_render(buffer, template, layout, view, locals)