diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2010-12-25 22:07:31 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2010-12-25 22:07:31 +0530 |
commit | 8618ef7537d055dfafd922fee4301e4da4189587 (patch) | |
tree | 75011fcd44151a22c8d3d4fe4aec3fc29ef01cbf /railties/guides/source | |
parent | b30293f2f654cfe321503520fc7caf31038f9ae3 (diff) | |
download | rails-8618ef7537d055dfafd922fee4301e4da4189587.tar.gz rails-8618ef7537d055dfafd922fee4301e4da4189587.tar.bz2 rails-8618ef7537d055dfafd922fee4301e4da4189587.zip |
highlighted find(array of keys) behaviour when one or more record is not found
Diffstat (limited to 'railties/guides/source')
-rw-r--r-- | railties/guides/source/active_record_querying.textile | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile index 61d8205278..6e45bf3188 100644 --- a/railties/guides/source/active_record_querying.textile +++ b/railties/guides/source/active_record_querying.textile @@ -150,7 +150,7 @@ SQL equivalent of the above is: SELECT * FROM clients WHERE (clients.id IN (1,10)) </sql> -<tt>Model.find(array_of_primary_key)</tt> will raise an +ActiveRecord::RecordNotFound+ exception unless a matching record is found for <strong>all</strong> of the supplied primary keys. +WARNING: <tt>Model.find(array_of_primary_key)</tt> will raise an +ActiveRecord::RecordNotFound+ exception unless a matching record is found for <strong>all</strong> of the supplied primary keys. h4. Retrieving Multiple Objects in Batches @@ -569,9 +569,7 @@ SELECT clients.* FROM clients LEFT OUTER JOIN addresses ON addresses.client_id = h4. Using Array/Hash of Named Associations -WARNING: This method only works with +INNER JOIN+, - -<br /> +WARNING: This method only works with +INNER JOIN+. Active Record lets you use the names of the "associations":association_basics.html defined on the model as a shortcut for specifying +JOIN+ clause for those associations when using the +joins+ method. |