Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

AR guide: fixes a query

  • Loading branch information...
commit 23abf46112289d379ad539528ab739f74b1e23aa 1 parent e0a0638
Xavier Noria fxn authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  railties/guides/source/active_record_querying.textile
2  railties/guides/source/active_record_querying.textile
View
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.