提交 b8e5d4f9 编写于 作者: R Ryuta Kamizono

Bring back passing single record support for `Preloader`

I removed redundant `Array.wrap(records)` since `Preloader` is nodoc
class and Active Record always pass `records` as an array to
`Preloader`.
But if users relies on that behavior, it is not worth dropping its
behavior.

Fixes #31661.
上级 d749b5d0
......@@ -83,7 +83,7 @@ class Preloader #:nodoc:
# { author: :avatar }
# [ :books, { author: :avatar } ]
def preload(records, associations, preload_scope = nil)
records = records.compact
records = Array.wrap(records).compact
if records.empty?
[]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册