forked from mirror/gorm
check for IsScanner on slices
This commit is contained in:
parent
1888335b6e
commit
d3ffcfab40
4
scope.go
4
scope.go
|
@ -351,7 +351,9 @@ func (scope *Scope) fieldFromStruct(fieldStruct reflect.StructField, withRelatio
|
|||
case reflect.Slice:
|
||||
typ = typ.Elem()
|
||||
|
||||
if (typ.Kind() == reflect.Struct) && withRelation {
|
||||
if field.IsScanner() {
|
||||
field.IsNormal = true
|
||||
} else if (typ.Kind() == reflect.Struct) && withRelation {
|
||||
if foreignKey == "" {
|
||||
foreignKey = scopeTyp.Name() + "Id"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue