Skip to content

Instantly share code, notes, and snippets.

@jesusabarca
jesusabarca / batch_resource.rb
Created March 24, 2017 18:58 — forked from elandesign/batch_resource.rb
Add find_each and find_in_batches functionality to ActiveResource
# Drop this into config/initializers
# The resource being consumed should honour the :page parameter (works great with will_paginate)
module ActiveResource
module Batches
module ClassMethods
def find_each(options = {})
find_in_batches(options) do |batch|
batch.each do |entry|