fix: Allowing the settings be passed through
This commit is contained in:
parent
79628be2c2
commit
26f701ab57
6
gorm.go
6
gorm.go
@ -316,6 +316,12 @@ func (db *DB) getInstance() *DB {
|
||||
Clauses: map[string]clause.Clause{},
|
||||
Vars: make([]interface{}, 0, 8),
|
||||
}
|
||||
|
||||
// Carry over the settings previously defined so that you can access them in the preload callbacks
|
||||
db.Statement.Settings.Range(func(k, v interface{}) bool {
|
||||
tx.Statement.Settings.Store(k, v)
|
||||
return true
|
||||
})
|
||||
} else {
|
||||
// with clone statement
|
||||
tx.Statement = db.Statement.clone()
|
||||
|
Loading…
x
Reference in New Issue
Block a user