Add Nested Preloading to README

This commit is contained in:
Jinzhu 2015-04-22 15:38:22 +08:00
parent 7693c093a9
commit 3c2915a9df
1 changed files with 7 additions and 0 deletions

View File

@ -347,6 +347,13 @@ db.Preload("Orders").Preload("Profile").Preload("Role").Find(&users)
//// SELECT * FROM roles WHERE id IN (4,5,6); // belongs to
```
#### Nested Preloading
```go
db.Preload("Orders.OrderItems").Find(&users)
db.Preload("Orders", "state = ?", "paid").Preload("Orders.OrderItems").Find(&users)
```
## Update
```go