From 8618ef7537d055dfafd922fee4301e4da4189587 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Sat, 25 Dec 2010 22:07:31 +0530 Subject: [PATCH] highlighted find(array of keys) behaviour when one or more record is not found --- railties/guides/source/active_record_querying.textile | 6 ++---- 1 file 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)) -Model.find(array_of_primary_key) will raise an +ActiveRecord::RecordNotFound+ exception unless a matching record is found for all of the supplied primary keys. +WARNING: Model.find(array_of_primary_key) will raise an +ActiveRecord::RecordNotFound+ exception unless a matching record is found for all 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+, - -
+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.