rails/rails — pull request #6323 by djones (2012-05-15 16:19:58+00:00)
Title: Documentation: make the 'Using Models in Your Migrations' example code more concise.

Along with this change simply being more concise, I think it's also preferable that we teach people to use the `update_all` method where possible instead of:

Product.all.each do |product|
product.update_attributes!(:flag => 'false')
end

This example above can get *extremely* slow with a lot of records because it first loads all the products into memory before writing to the database.