forked from mirror/gorm
Merge pull request #483 from xconstruct/fix_ignore_where
Fix including ignored field in Where condition
This commit is contained in:
commit
826e384f32
|
@ -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())))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue