From a0c527f1cce14d6b0d9f13b5f41080365e4b86ae Mon Sep 17 00:00:00 2001 From: Constantin Schomburg Date: Sat, 9 May 2015 13:12:13 +0200 Subject: [PATCH] Fix including ignored field in Where condition --- scope_private.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scope_private.go b/scope_private.go index b9476455..4ecefe3a 100644 --- a/scope_private.go +++ b/scope_private.go @@ -38,7 +38,7 @@ func (scope *Scope) buildWhereCondition(clause map[string]interface{}) (str stri case interface{}: var sqls []string 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()))) } }