mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix SQL result of Book.joins(reviews: :customer)
query example
This commit is contained in:
parent
ad9e52066c
commit
7a0cb3d239
1 changed files with 2 additions and 2 deletions
|
@ -1254,8 +1254,8 @@ This produces:
|
|||
|
||||
```sql
|
||||
SELECT books.* FROM books
|
||||
INNER JOIN reviews ON reviews.book_id = book.id
|
||||
INNER JOIN customer ON customers.id = reviews.id
|
||||
INNER JOIN reviews ON reviews.book_id = books.id
|
||||
INNER JOIN customers ON customers.id = reviews.customer_id
|
||||
```
|
||||
|
||||
Or, in English: "return all books that have a review by a customer."
|
||||
|
|
Loading…
Reference in a new issue