From 429bd260c1cca8af1aac0ec31b85e487dc14b123 Mon Sep 17 00:00:00 2001 From: yui-knk Date: Fri, 13 Nov 2015 11:41:24 +0900 Subject: Respect value of `:object` if `:object` is false when rendering This commit fixes the bug convering `false` to `locals[as]` when `options[:object]` is `false` (close #22260). --- actionview/lib/action_view/renderer/partial_renderer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionview/lib') diff --git a/actionview/lib/action_view/renderer/partial_renderer.rb b/actionview/lib/action_view/renderer/partial_renderer.rb index a78bf0a6e9..bdbf03191a 100644 --- a/actionview/lib/action_view/renderer/partial_renderer.rb +++ b/actionview/lib/action_view/renderer/partial_renderer.rb @@ -337,7 +337,7 @@ module ActionView layout = find_template(layout.to_s, @template_keys) end - object ||= locals[as] + object = locals[as] if object.nil? # Respect object when object is false locals[as] = object if @has_object content = @template.render(view, locals) do |*name| -- cgit v1.2.3