aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorSergio <shernade@gmail.com>2013-11-18 18:39:06 +0100
committerSergio <shernade@gmail.com>2013-11-18 18:39:06 +0100
commitac35f72f30c47298a20a90c8c537db888b463bbb (patch)
treea80e836366313b7c5074fc98103dbadf47f599b6 /guides/source
parentc365986b48c3e8bc8c7f3fa6a8521616ed5dc138 (diff)
downloadrails-ac35f72f30c47298a20a90c8c537db888b463bbb.tar.gz
rails-ac35f72f30c47298a20a90c8c537db888b463bbb.tar.bz2
rails-ac35f72f30c47298a20a90c8c537db888b463bbb.zip
syntax error joining/including models
syntax error joining/including models
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/active_record_querying.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md
index 7d641b67ba..0f9b2c28a5 100644
--- a/guides/source/active_record_querying.md
+++ b/guides/source/active_record_querying.md
@@ -1101,7 +1101,7 @@ Active Record lets you eager load any number of associations with a single `Mode
#### Array of Multiple Associations
```ruby
-Post.includes(:category, :comments)
+Post.includes(:category, :comment)
```
This loads all the posts and the associated category and comments for each post.
@@ -1121,7 +1121,7 @@ Even though Active Record lets you specify conditions on the eager loaded associ
However if you must do this, you may use `where` as you would normally.
```ruby
-Post.includes(:comments).where("comments.visible" => true)
+Post.includes(:comment).where("comments.visible" => true)
```
This would generate a query which contains a `LEFT OUTER JOIN` whereas the `joins` method would generate one using the `INNER JOIN` function instead.