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.