mirror of https://github.com/go-gorm/gorm.git
title foreign schema for many2many to avoid panic (#4496)
Co-authored-by: yuehong.wang <yuehong.wang@dena.jp>
This commit is contained in:
parent
16579e00c6
commit
80497f27a6
|
@ -238,7 +238,7 @@ func (schema *Schema) buildMany2ManyRelation(relation *Relationship, field *Fiel
|
||||||
}
|
}
|
||||||
|
|
||||||
for idx, relField := range refForeignFields {
|
for idx, relField := range refForeignFields {
|
||||||
joinFieldName := relation.FieldSchema.Name + relField.Name
|
joinFieldName := strings.Title(relation.FieldSchema.Name) + relField.Name
|
||||||
if len(joinReferences) > idx {
|
if len(joinReferences) > idx {
|
||||||
joinFieldName = strings.Title(joinReferences[idx])
|
joinFieldName = strings.Title(joinReferences[idx])
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue