diff options
author | Xavier Noria <fxn@hashref.com> | 2009-03-14 16:05:51 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2009-03-14 16:05:51 +0100 |
commit | 5367434bdd9802eed9b4f39c2f2bde75a2232336 (patch) | |
tree | 20b28297c9d8652ae9bb4795e0f432b1463a9584 /railties/guides/source/active_record_querying.textile | |
parent | 0e19ba6f20712a015c6aec5c87bb8e8fde741b9f (diff) | |
download | rails-5367434bdd9802eed9b4f39c2f2bde75a2232336.tar.gz rails-5367434bdd9802eed9b4f39c2f2bde75a2232336.tar.bz2 rails-5367434bdd9802eed9b4f39c2f2bde75a2232336.zip |
minor details in the querying guide
Diffstat (limited to 'railties/guides/source/active_record_querying.textile')
-rw-r--r-- | railties/guides/source/active_record_querying.textile | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile index 055fe00e6a..5bf873b808 100644 --- a/railties/guides/source/active_record_querying.textile +++ b/railties/guides/source/active_record_querying.textile @@ -173,7 +173,7 @@ Sometimes you need to iterate over a large set of records. For example to send a The following may seem very straight forward at first: <ruby> -# Very inefficient when users table has thousands of rows +# Very inefficient when users table has thousands of rows. User.all.each do |user| NewsLetter.weekly_deliver(user) end @@ -219,7 +219,7 @@ end *Additional options* -+find_each+ accepts the same options as the regular +find+ method. However, +:order+ and +:limit+ are needed internally and hence not allowed to be passes explicitly. ++find_each+ accepts the same options as the regular +find+ method. However, +:order+ and +:limit+ are needed internally and hence not allowed to be passed explicitly. h5. +find_in_batches+ @@ -843,7 +843,7 @@ Client.find_by_sql("SELECT * FROM clients +find_by_sql+ provides you with a simple way of making custom calls to the database and retrieving instantiated objects. -h3. select_all +h3. +select_all+ <tt>find_by_sql</tt> has a close relative called +connection#select_all+. +select_all+ will retrieve objects from the database using custom SQL just like +find_by_sql+ but will not instantiate them. Instead, you will get an array of hashes where each hash indicates a record. |