fix: added SkipHooks in db getInstance()

This commit is contained in:
Aayush Acharya 2023-07-27 14:50:54 +05:45
parent a7f01bd1b2
commit c530ed8561

11
gorm.go
View File

@ -399,11 +399,12 @@ func (db *DB) getInstance() *DB {
if db.clone == 1 { if db.clone == 1 {
// clone with new statement // clone with new statement
tx.Statement = &Statement{ tx.Statement = &Statement{
DB: tx, DB: tx,
ConnPool: db.Statement.ConnPool, ConnPool: db.Statement.ConnPool,
Context: db.Statement.Context, Context: db.Statement.Context,
Clauses: map[string]clause.Clause{}, Clauses: map[string]clause.Clause{},
Vars: make([]interface{}, 0, 8), Vars: make([]interface{}, 0, 8),
SkipHooks: db.Statement.SkipHooks,
} }
} else { } else {
// with clone statement // with clone statement