I was directed here from the rails repo.
Currently find_in_batches
converts all relations into arrays before yielding to the block.
It would be nice if we could just work with relations (which are lazy if I can recall correctly) and allow the consumer to manipulate data as deemed fit. This will also allow some operations to be performed in batches (i.e. staggeringupdate_all
) instead of needing to recreate the set.
Looking at the code it shouldn’t be hard to implement, and I don’t mind working on the patch. I just wanted to get feedback on this before I go ahead and write up the code.