aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-08-06 13:33:02 +0200
committerXavier Noria <fxn@hashref.com>2010-08-06 13:33:02 +0200
commit23abf46112289d379ad539528ab739f74b1e23aa (patch)
treef29450e0644373c23ea10c0c2fb4e10768961642 /railties
parente0a0638094192061b5537f776a6a250b85cb09b8 (diff)
downloadrails-23abf46112289d379ad539528ab739f74b1e23aa.tar.gz
rails-23abf46112289d379ad539528ab739f74b1e23aa.tar.bz2
rails-23abf46112289d379ad539528ab739f74b1e23aa.zip
AR guide: fixes a query
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/active_record_querying.textile2
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/guides/source/active_record_querying.textile b/railties/guides/source/active_record_querying.textile
index 5c4ed3a803..53095a2bd3 100644
--- a/railties/guides/source/active_record_querying.textile
+++ b/railties/guides/source/active_record_querying.textile
@@ -764,7 +764,7 @@ This loads all the posts and the associated category and comments for each post.
h5. Nested Associations Hash
<ruby>
-Category.find(1).includes(:posts => [{:comments => :guest}, :tags])
+Category.includes(:posts => [{:comments => :guest}, :tags]).find(1)
</ruby>
This will find the category with id 1 and eager load all of the associated posts, the associated posts' tags and comments, and every comment's guest association.