我正在实施这里提到的 Model.find_each :
http://edgeguides.rubyonrails.org/active_record_querying.html#retrieving-multiple-objects-in-batches
但我收到此错误消息:
Ruby ActiveRecord: DEPRECATION WARNING: Relation#find_in_batches with finder options is deprecated. Please build a scope and then call find_in_batches on it instead.
对于此代码:
Person.find_each(start: start_index, limit: limit) do |person|
我几乎遵循文档中给出的代码,所以我有点困惑。此代码是否正确,如果不正确,解决方法是什么?