aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/renderer/template_renderer.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2019-02-22 10:39:25 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2019-02-22 10:39:25 -0800
commit1cf3878927c086828d7a3010012334859c98d643 (patch)
treece125d2a8381367af3ed141fc53c3e1f010b14ba /actionview/lib/action_view/renderer/template_renderer.rb
parent3b6602aa7a01fb415fce07ef32458b131e5762e1 (diff)
downloadrails-1cf3878927c086828d7a3010012334859c98d643.tar.gz
rails-1cf3878927c086828d7a3010012334859c98d643.tar.bz2
rails-1cf3878927c086828d7a3010012334859c98d643.zip
Pass lookup context to the layout handlers
I want to start reducing the calls to `lookup_context`. That method caches the lookup context in an ivar, but I would like to cache the lookup context on the stack. That way we aren't coupled to the behavior of the `lookup_context` method.
Diffstat (limited to 'actionview/lib/action_view/renderer/template_renderer.rb')
-rw-r--r--actionview/lib/action_view/renderer/template_renderer.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionview/lib/action_view/renderer/template_renderer.rb b/actionview/lib/action_view/renderer/template_renderer.rb
index c17d6182e8..b6861d49fe 100644
--- a/actionview/lib/action_view/renderer/template_renderer.rb
+++ b/actionview/lib/action_view/renderer/template_renderer.rb
@@ -88,7 +88,7 @@ module ActionView
raise unless template_exists?(layout, nil, false, [], all_details)
end
when Proc
- resolve_layout(layout.call(formats), keys, formats)
+ resolve_layout(layout.call(@lookup_context, formats), keys, formats)
else
layout
end