aboutsummaryrefslogtreecommitdiffstats
path: root/actionview
diff options
context:
space:
mode:
authorSean Griffin <sean@thoughtbot.com>2014-11-25 15:57:00 -0700
committerSean Griffin <sean@thoughtbot.com>2014-11-25 15:57:00 -0700
commit2f8be7ebafcf7815f9f3ec7983789157525a60fa (patch)
treef65de53947e7439d1396fe39bd5ddcd31886e727 /actionview
parent3802de4a769092a4b6477e9b5ec0636938c5a957 (diff)
downloadrails-2f8be7ebafcf7815f9f3ec7983789157525a60fa.tar.gz
rails-2f8be7ebafcf7815f9f3ec7983789157525a60fa.tar.bz2
rails-2f8be7ebafcf7815f9f3ec7983789157525a60fa.zip
Fix warning in AV tests
Originally caused by #17771
Diffstat (limited to 'actionview')
-rw-r--r--actionview/lib/action_view/renderer/partial_renderer.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/actionview/lib/action_view/renderer/partial_renderer.rb b/actionview/lib/action_view/renderer/partial_renderer.rb
index 338ae270d2..f627d5d40c 100644
--- a/actionview/lib/action_view/renderer/partial_renderer.rb
+++ b/actionview/lib/action_view/renderer/partial_renderer.rb
@@ -366,10 +366,12 @@ module ActionView
partial = options[:partial]
if String === partial
- @object = options[:object] if options.has_key?(:object)
+ @has_object = options.key?(:object)
+ @object = options[:object]
@collection = collection_from_options
@path = partial
else
+ @has_object = true
@object = partial
@collection = collection_from_object || collection_from_options
@@ -506,7 +508,7 @@ module ActionView
def retrieve_template_keys
keys = @locals.keys
- keys << @variable if defined?(@object) || @collection
+ keys << @variable if @has_object || @collection
if @collection
keys << @variable_counter
keys << @variable_iteration