Merge pull request #483 from xconstruct/fix_ignore_where

Fix including ignored field in Where condition
This commit is contained in:
Jinzhu 2015-05-11 15:01:39 +08:00
commit 826e384f32
1 changed files with 1 additions and 1 deletions

View File

@ -38,7 +38,7 @@ func (scope *Scope) buildWhereCondition(clause map[string]interface{}) (str stri
case interface{}: case interface{}:
var sqls []string var sqls []string
for _, field := range scope.New(value).Fields() { for _, field := range scope.New(value).Fields() {
if !field.IsBlank { if !field.IsIgnored && !field.IsBlank {
sqls = append(sqls, fmt.Sprintf("(%v = %v)", scope.Quote(field.DBName), scope.AddToVars(field.Field.Interface()))) sqls = append(sqls, fmt.Sprintf("(%v = %v)", scope.Quote(field.DBName), scope.AddToVars(field.Field.Interface())))
} }
} }