Default to an empty collection if falsey given

This will ensure we attempt to render an empty collection, meaning we
don't actually render anything at all. Allowing `nil` or a falsey value
through results in calling `render_partial` rather than
`render_collection`, which isn't what we want.
This commit is contained in:
Steven Harman 2016-07-26 10:37:10 -04:00
parent 578096b971
commit e4a4936244

@ -403,7 +403,7 @@ def setup(context, options, block)
def collection_from_options
if @options.key?(:collection)
collection = @options[:collection]
collection = @options[:collection] || []
collection = collection.to_ary if collection.respond_to?(:to_ary)
collection
end