You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/source/active_record_querying.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1640,7 +1640,7 @@ The above code will execute just **2** queries, as opposed to the **11** queries
1640
1640
```sql
1641
1641
SELECT books.*FROM books LIMIT10
1642
1642
SELECT authors.*FROM authors
1643
-
WHEREauthors.book_idIN (1,2,3,4,5,6,7,8,9,10)
1643
+
WHEREauthors.idIN (1,2,3,4,5,6,7,8,9,10)
1644
1644
```
1645
1645
1646
1646
#### Eager Loading Multiple Associations
@@ -1717,7 +1717,7 @@ The above code will execute just **2** queries, as opposed to the **11** queries
1717
1717
```sql
1718
1718
SELECT books.*FROM books LIMIT10
1719
1719
SELECT authors.*FROM authors
1720
-
WHEREauthors.book_idIN (1,2,3,4,5,6,7,8,9,10)
1720
+
WHEREauthors.idIN (1,2,3,4,5,6,7,8,9,10)
1721
1721
```
1722
1722
1723
1723
NOTE: The `preload` method uses an array, hash, or a nested hash of array/hash in the same way as the `includes` method to load any number of associations with a single `Model.find` call. However, unlike the `includes` method, it is not possible to specify conditions for preloaded associations.
@@ -1739,9 +1739,9 @@ end
1739
1739
The above code will execute just **2** queries, as opposed to the **11** queries from the original case:
1740
1740
1741
1741
```sql
1742
-
SELECT DISTINCTbooks.idFROM books LEFT OUTER JOIN authors ONauthors.book_id=books.idLIMIT10
1742
+
SELECT DISTINCTbooks.idFROM books LEFT OUTER JOIN authors ONauthors.id=books.author_idLIMIT10
0 commit comments