Update main.go

Ex:
```go
type User struct {
	ID        int64
	Name      string `sql:"not null;unique"`
	Hobby     []string `sql:"-"`
	HobbyStr  string `sql:"type:text"`
}
u := &User{Name:"ElvizLai"}
fmt.Println(db.Last(u, "5x").RecordNotFound())//should be true but it return false
```
It has error: "Unknown column '5x' in 'where clause'", This maybe also belongs to "RecordNotFound"
This commit is contained in:
Yongzheng Lai 2016-02-16 14:09:01 +08:00
parent aa45da1542
commit a582f801e1

View File

@ -369,7 +369,7 @@ func (s *DB) NewRecord(value interface{}) bool {
}
func (s *DB) RecordNotFound() bool {
return s.Error == RecordNotFound
return s.Error == RecordNotFound || s.Error != nil
}
// Migrations