class ActiveRecord::Batches::BatchEnumerator

def delete_all

See Relation#delete_all for details of how each batch is deleted.

Person.in_batches.delete_all

Deletes records in batches. Returns the total number of rows affected.
def delete_all
  sum(&:delete_all)
end