1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

English explanation to multi-level nested join

Added an "Or, in English..." explanation to the "Joining Nested Associations (Multiple Level)" example.
This commit is contained in:
Collin Graves 2016-01-27 21:54:34 -06:00
parent b2fe263fa6
commit 69d657db6f

View file

@ -1085,6 +1085,8 @@ SELECT categories.* FROM categories
INNER JOIN tags ON tags.article_id = articles.id INNER JOIN tags ON tags.article_id = articles.id
``` ```
Or, in English: "return all categories that have articles, where those articles have a comment made by a guest, and where those articles also have a tag."
#### Specifying Conditions on the Joined Tables #### Specifying Conditions on the Joined Tables
You can specify conditions on the joined tables using the regular [Array](#array-conditions) and [String](#pure-string-conditions) conditions. [Hash conditions](#hash-conditions) provide a special syntax for specifying conditions for the joined tables: You can specify conditions on the joined tables using the regular [Array](#array-conditions) and [String](#pure-string-conditions) conditions. [Hash conditions](#hash-conditions) provide a special syntax for specifying conditions for the joined tables: