Fix gorm:"-" When the query is not working to issues 2048

Fix https://github.com/jinzhu/gorm/issues/2048
This commit is contained in:
axxapp 2018-08-23 00:07:25 +08:00 committed by GitHub
parent 32455088f2
commit 2515ff8e25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,6 +112,9 @@ func (scope *Scope) Fields() []*Field {
) )
for _, structField := range scope.GetModelStruct().StructFields { for _, structField := range scope.GetModelStruct().StructFields {
if structField.IsIgnored {
continue
}
if isStruct { if isStruct {
fieldValue := indirectScopeValue fieldValue := indirectScopeValue
for _, name := range structField.Names { for _, name := range structField.Names {