mirror of https://github.com/go-gorm/gorm.git
Don't parse ignored anonymous field
This commit is contained in:
parent
15b96ed3f4
commit
a3dda47afa
|
@ -311,7 +311,7 @@ func (schema *Schema) ParseField(fieldStruct reflect.StructField) *Field {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := field.TagSettings["EMBEDDED"]; ok || (fieldStruct.Anonymous && !isValuer) {
|
if _, ok := field.TagSettings["EMBEDDED"]; ok || (fieldStruct.Anonymous && !isValuer && (field.Creatable || field.Updatable || field.Readable)) {
|
||||||
if reflect.Indirect(fieldValue).Kind() == reflect.Struct {
|
if reflect.Indirect(fieldValue).Kind() == reflect.Struct {
|
||||||
var err error
|
var err error
|
||||||
field.Creatable = false
|
field.Creatable = false
|
||||||
|
|
Loading…
Reference in New Issue