Skip to content

Commit 7ebb320

Browse files
committed
Allow customize join table's table in callback
1 parent f9131e3 commit 7ebb320

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

callbacks/preload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func preload(db *gorm.DB, rels []*schema.Relationship, conds []interface{}) {
4949
}
5050

5151
joinResults := rel.JoinTable.MakeSlice().Elem()
52-
column, values := schema.ToQueryValues(rel.JoinTable.Table, joinForeignKeys, joinForeignValues)
52+
column, values := schema.ToQueryValues(clause.CurrentTable, joinForeignKeys, joinForeignValues)
5353
db.AddError(tx.Where(clause.IN{Column: column, Values: values}).Find(joinResults.Addr().Interface()).Error)
5454

5555
// convert join identity map to relation identity map

0 commit comments

Comments
 (0)