mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix typo where a table name in a join was singular.
This commit is contained in:
parent
749ced1767
commit
256e317c39
1 changed files with 1 additions and 1 deletions
|
@ -834,7 +834,7 @@ SELECT categories.* FROM categories
|
|||
INNER JOIN posts ON posts.category_id = categories.id
|
||||
</sql>
|
||||
|
||||
Or, in English: "return a Category object for all categories with posts". Note that you will see duplicate categories if more than one post has the same category. If you want unique categories, you can use Category.joins(:post).select("distinct(categories.id)").
|
||||
Or, in English: "return a Category object for all categories with posts". Note that you will see duplicate categories if more than one post has the same category. If you want unique categories, you can use Category.joins(:posts).select("distinct(categories.id)").
|
||||
|
||||
h5. Joining Multiple Associations
|
||||
|
||||
|
|
Loading…
Reference in a new issue