aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2009-03-12 13:49:52 +0100
committerXavier Noria <fxn@hashref.com>2009-03-12 13:49:52 +0100
commitc351aec92f1e56b6e145b5b58ac245da34c02840 (patch)
tree8dc7a759e26242481b9f84e289906e70c08bdf52 /railties/guides
parentb69f027ec1e48ae88ab7af6c8624b133e81e3554 (diff)
downloadrails-c351aec92f1e56b6e145b5b58ac245da34c02840.tar.gz
rails-c351aec92f1e56b6e145b5b58ac245da34c02840.tar.bz2
rails-c351aec92f1e56b6e145b5b58ac245da34c02840.zip
each -> find_each in 2.3 release notes
Diffstat (limited to 'railties/guides')
-rw-r--r--railties/guides/source/2_3_release_notes.textile10
1 files changed, 5 insertions, 5 deletions
diff --git a/railties/guides/source/2_3_release_notes.textile b/railties/guides/source/2_3_release_notes.textile
index 654b2922c4..e9022aa044 100644
--- a/railties/guides/source/2_3_release_notes.textile
+++ b/railties/guides/source/2_3_release_notes.textile
@@ -141,19 +141,19 @@ end
You can pass most of the +find+ options into +find_in_batches+. However, you cannot specify the order that records will be returned in (they will always be returned in ascending order of primary key, which must be an integer), or use the +:limit+ option. Instead, use the +:batch_size+ option, which defaults to 1000, to set the number of records that will be returned in each batch.
-The new +each+ method provides a wrapper around +find_in_batches+ that returns individual records, with the find itself being done in batches (of 1000 by default):
+The new +find_each+ method provides a wrapper around +find_in_batches+ that returns individual records, with the find itself being done in batches (of 1000 by default):
<ruby>
-Customer.each do |customer|
+Customer.find_each do |customer|
customer.update_account_balance!
end
</ruby>
Note that you should only use this method for batch processing: for small numbers of records (less than 1000), you should just use the regular find methods with your own loop.
-* More Information:
- - "Rails 2.3: Batch Finding":http://afreshcup.com/2009/02/23/rails-23-batch-finding/
- - "What's New in Edge Rails: Batched Find":http://ryandaigle.com/articles/2009/2/23/what-s-new-in-edge-rails-batched-find
+* More Information (at that point the convenience method was called just +each+):
+** "Rails 2.3: Batch Finding":http://afreshcup.com/2009/02/23/rails-23-batch-finding/
+** "What's New in Edge Rails: Batched Find":http://ryandaigle.com/articles/2009/2/23/what-s-new-in-edge-rails-batched-find
h4. Multiple Conditions for Callbacks