Edge rails: ActiveRecord::Base.each and ActiveRecord::Base.find_in_batches for batch processing

Published on Author Akhil Bansal2 Comments

You guys must faced a situation when you need to process large number of records, for example sending newsletters. Then you must have done some sort of batch processing to save it eating up all of your memory. This feature is committed to rails core by DHH.

Now you can do something like User.each and User.find_in_batches.

Please refer here for more details.

2 Responses to Edge rails: ActiveRecord::Base.each and ActiveRecord::Base.find_in_batches for batch processing

  1. You might want to know in your post that .each has been changed to find_each to resolve some conflicts.

    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *