mirror of https://github.com/go-gorm/gorm.git
Preload with settings, close #3945
This commit is contained in:
parent
79628be2c2
commit
59fa07953c
callbacks
|
@ -22,6 +22,11 @@ func preload(db *gorm.DB, rels []*schema.Relationship, conds []interface{}) {
|
|||
inlineConds []interface{}
|
||||
)
|
||||
|
||||
db.Statement.Settings.Range(func(k, v interface{}) bool {
|
||||
tx.Statement.Settings.Store(k, v)
|
||||
return true
|
||||
})
|
||||
|
||||
if len(rels) > 1 {
|
||||
reflectValue = schema.GetRelationsValues(reflectValue, rels[:len(rels)-1])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue