提交 e4a49362 编写于 作者: S Steven Harman

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.
上级 578096b9
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册