"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "guides/source/active_record_querying.md" between
rails-6.1.3.2.tar.gz and rails-6.1.4.tar.gz

About: Ruby on Rails is a web application development framework (written in Ruby).

active_record_querying.md  (rails-6.1.3.2):active_record_querying.md  (rails-6.1.4)
skipping to change at line 1257 skipping to change at line 1257
##### Joining Nested Associations (Single Level) ##### Joining Nested Associations (Single Level)
```ruby ```ruby
Book.joins(reviews: :customer) Book.joins(reviews: :customer)
``` ```
This produces: This produces:
```sql ```sql
SELECT books.* FROM books SELECT books.* FROM books
INNER JOIN reviews ON reviews.book_id = book.id INNER JOIN reviews ON reviews.book_id = books.id
INNER JOIN customer ON customers.id = reviews.id INNER JOIN customers ON customers.id = reviews.customer_id
``` ```
Or, in English: "return all books that have a review by a customer." Or, in English: "return all books that have a review by a customer."
##### Joining Nested Associations (Multiple Level) ##### Joining Nested Associations (Multiple Level)
```ruby ```ruby
Author.joins(books: [{reviews: { customer: :orders} }, :supplier] ) Author.joins(books: [{reviews: { customer: :orders} }, :supplier] )
``` ```
 End of changes. 1 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)