Navigation Menu

Skip to content

Commit

Permalink
Merge pull request #35337 from abhaynikam/35265-remove-unused-argumen…
Browse files Browse the repository at this point in the history
…t-layout-from-rendered-template

Removed unused layout attribute from RenderedTemplate
  • Loading branch information
rafaelfranca committed May 1, 2019
2 parents 51a481f + 1de6a20 commit a0434ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
9 changes: 4 additions & 5 deletions actionview/lib/action_view/renderer/abstract_renderer.rb
Expand Up @@ -59,11 +59,10 @@ def body; nil; end
end

class RenderedTemplate # :nodoc:
attr_reader :body, :layout, :template
attr_reader :body, :template

def initialize(body, layout, template)
def initialize(body, template)
@body = body
@layout = layout
@template = template
end

Expand Down Expand Up @@ -97,8 +96,8 @@ def prepend_formats(formats) # :doc:
@lookup_context.formats = formats | @lookup_context.formats
end

def build_rendered_template(content, template, layout = nil)
RenderedTemplate.new content, layout, template
def build_rendered_template(content, template)
RenderedTemplate.new content, template
end

def build_rendered_collection(templates, spacer)
Expand Down
4 changes: 2 additions & 2 deletions actionview/lib/action_view/renderer/partial_renderer.rb
Expand Up @@ -364,7 +364,7 @@ def render_partial(view, template)

content = layout.render(view, locals) { content } if layout
payload[:cache_hit] = view.view_renderer.cache_hits[template.virtual_path]
build_rendered_template(content, template, layout)
build_rendered_template(content, template)
end
end

Expand Down Expand Up @@ -455,7 +455,7 @@ def collection_with_template(view, template)
content = template.render(view, locals)
content = layout.render(view, locals) { content } if layout
partial_iteration.iterate!
build_rendered_template(content, template, layout)
build_rendered_template(content, template)
end
end

Expand Down
2 changes: 1 addition & 1 deletion actionview/lib/action_view/renderer/template_renderer.rb
Expand Up @@ -71,7 +71,7 @@ def render_with_layout(view, template, path, locals)
else
content
end
build_rendered_template(body, template, layout)
build_rendered_template(body, template)
end

# This is the method which actually finds the layout using details in the lookup
Expand Down

0 comments on commit a0434ce

Please sign in to comment.