Merge f2f4ef81cac8a0daf9076575c88d081c3349003e into 5330572c258c16742c3052af3f82f67031112f2e

This commit is contained in:
Conrad Pankoff 2015-01-22 07:42:02 +00:00
commit 594e178926

View File

@ -2,6 +2,7 @@ package gorm
import ( import (
"fmt" "fmt"
"reflect"
"strings" "strings"
) )
@ -30,7 +31,11 @@ func Create(scope *Scope) {
continue continue
} }
columns = append(columns, scope.Quote(field.DBName)) columns = append(columns, scope.Quote(field.DBName))
sqls = append(sqls, scope.AddToVars(field.Field.Interface())) val := field.Field
if val.Kind() == reflect.Struct {
val = val.Addr()
}
sqls = append(sqls, scope.AddToVars(val.Interface()))
} }
} }