sunspot/sunspot — pull request #393 by christophemaximin (2013-03-30 14:44:49+00:00)
Title: Rails 4: replaced deprecated finder option "include" from find_in_batches options

As you can see in the official gem rails/activerecord-deprecated_finders, using finder options in find_in_batches, namely "include" in that case, has been deprecated.

Warning message:

Relation#find_in_batches with finder options is deprecated. Please build a scope and then call find_in_batches on it instead.

This fixes the problem using Rails 3 and Rails 4 Relation#includes method. The behaviour stays the same for Rails 2.3.