forked from mirror/gorm
Fix Set/Get settings when saving associations, close #3908
This commit is contained in:
parent
53b3ebdd1d
commit
6d260a86bd
|
@ -363,6 +363,11 @@ func saveAssociations(db *gorm.DB, rel *schema.Relationship, values interface{},
|
||||||
DisableNestedTransaction: true,
|
DisableNestedTransaction: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
db.Statement.Settings.Range(func(k, v interface{}) bool {
|
||||||
|
tx.Statement.Settings.Store(k, v)
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
|
||||||
if len(selects) > 0 {
|
if len(selects) > 0 {
|
||||||
tx = tx.Select(selects)
|
tx = tx.Select(selects)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue