From d3ffcfab400c95abd057a396d2fa9c10b3438f28 Mon Sep 17 00:00:00 2001 From: deoxxa Date: Fri, 30 Jan 2015 21:24:56 +1100 Subject: [PATCH] check for IsScanner on slices --- scope.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scope.go b/scope.go index 698ed0bb..076fc336 100644 --- a/scope.go +++ b/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" }