method

update_all

rails latest stable - Class: ActiveRecord::Batches::BatchEnumerator
update_all(updates)
public

Updates records in batches. Returns the total number of rows affected.

Person.in_batches.update_all("age = age + 1")

See Relation#update_all for details of how each batch is updated.