mirror of https://github.com/go-gorm/gorm.git
Allow customize join table's table in callback
This commit is contained in:
parent
f9131e309d
commit
7ebb320f3e
|
@ -49,7 +49,7 @@ func preload(db *gorm.DB, rels []*schema.Relationship, conds []interface{}) {
|
|||
}
|
||||
|
||||
joinResults := rel.JoinTable.MakeSlice().Elem()
|
||||
column, values := schema.ToQueryValues(rel.JoinTable.Table, joinForeignKeys, joinForeignValues)
|
||||
column, values := schema.ToQueryValues(clause.CurrentTable, joinForeignKeys, joinForeignValues)
|
||||
db.AddError(tx.Where(clause.IN{Column: column, Values: values}).Find(joinResults.Addr().Interface()).Error)
|
||||
|
||||
// convert join identity map to relation identity map
|
||||
|
|
Loading…
Reference in New Issue