From 2515ff8e25d2bc2e3a747ab5904dd88ddb47ea1f Mon Sep 17 00:00:00 2001 From: axxapp Date: Thu, 23 Aug 2018 00:07:25 +0800 Subject: [PATCH] Fix gorm:"-" When the query is not working to issues 2048 Fix https://github.com/jinzhu/gorm/issues/2048 --- scope.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scope.go b/scope.go index ca861d8a..4237e0ec 100644 --- a/scope.go +++ b/scope.go @@ -112,6 +112,9 @@ func (scope *Scope) Fields() []*Field { ) for _, structField := range scope.GetModelStruct().StructFields { + if structField.IsIgnored { + continue + } if isStruct { fieldValue := indirectScopeValue for _, name := range structField.Names {