diff options
author | yui-knk <spiketeika@gmail.com> | 2015-11-13 11:41:24 +0900 |
---|---|---|
committer | yui-knk <spiketeika@gmail.com> | 2015-11-13 12:26:15 +0900 |
commit | 429bd260c1cca8af1aac0ec31b85e487dc14b123 (patch) | |
tree | 8791424d41845e5e0a2391a23414bac23da41896 /actionview/lib | |
parent | 0db310586ac3e15be95d2ef27ff40cfa24c05c10 (diff) | |
download | rails-429bd260c1cca8af1aac0ec31b85e487dc14b123.tar.gz rails-429bd260c1cca8af1aac0ec31b85e487dc14b123.tar.bz2 rails-429bd260c1cca8af1aac0ec31b85e487dc14b123.zip |
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).
Diffstat (limited to 'actionview/lib')
-rw-r--r-- | actionview/lib/action_view/renderer/partial_renderer.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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| |