diff --git a/main_test.go b/main_test.go index 6d89659a..dc60de24 100644 --- a/main_test.go +++ b/main_test.go @@ -40,7 +40,8 @@ type User struct { CreditCard CreditCard Latitude float64 PasswordHash []byte - IgnoreMe int64 `sql:"-"` + IgnoreMe int64 `sql:"-"` + IgnoreStringSlice []string `sql:"-"` } type CreditCard struct { diff --git a/scope.go b/scope.go index dba091af..78742d89 100644 --- a/scope.go +++ b/scope.go @@ -252,7 +252,7 @@ func (scope *Scope) Fields() []*Field { case reflect.Slice: typ = typ.Elem() - if _, ok := field.Value.([]byte); !ok { + if typ.Kind() == reflect.Struct { foreignKey := scopeTyp.Name() + "Id" if reflect.New(typ).Elem().FieldByName(foreignKey).IsValid() { field.ForeignKey = foreignKey