Merge 3601b19cbd31252723ecda0f4feb0f92e5e3e290 into 9acaa33324bbcc78239a1c913d4f1292c12177b9
This commit is contained in:
commit
89ce7b3bd6
2
scope.go
2
scope.go
@ -999,7 +999,7 @@ func (scope *Scope) related(value interface{}, foreignKeys ...string) *Scope {
|
||||
toScope := scope.db.NewScope(value)
|
||||
tx := scope.db.Set("gorm:association:source", scope.Value)
|
||||
|
||||
for _, foreignKey := range append(foreignKeys, toScope.typeName()+"Id", scope.typeName()+"Id") {
|
||||
for _, foreignKey := range append(foreignKeys, toScope.typeName()+"ID", scope.typeName()+"ID") {
|
||||
fromField, _ := scope.FieldByName(foreignKey)
|
||||
toField, _ := toScope.FieldByName(foreignKey)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user