check for IsScanner on slices

This commit is contained in:
deoxxa 2015-01-30 21:24:56 +11:00
parent 1888335b6e
commit d3ffcfab40
1 changed files with 3 additions and 1 deletions

View File

@ -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"
}