class ActiveRecord::Batches::BatchEnumerator

def destroy_all

See Relation#destroy_all for details of how each batch is destroyed.

Person.where("age < 10").in_batches.destroy_all

Destroys records in batches.
def destroy_all
  each(&:destroy_all)
end