Fix error handling around exists

This commit is contained in:
Aaron L 2016-09-20 19:34:01 -07:00
parent 23aca7a9ce
commit f48b041daa

View file

@ -1026,10 +1026,10 @@ you will need to call the `Reload` methods on those yourself.
jet, err := models.FindJet(db, 1)
// Check if the pilot assigned to this jet exists.
exists := jet.Pilot(db).Exists()
exists, err := jet.Pilot(db).Exists()
// Check if the pilot with ID 5 exists
exists := models.Pilots(db, Where("id=?", 5)).Exists()
exists, err := models.Pilots(db, Where("id=?", 5)).Exists()
```
## FAQ