mirror of https://github.com/go-gorm/gorm.git
Inherit SkipHooks option when preloading associations, close #3772
This commit is contained in:
parent
d66af581b4
commit
e3b4e0418f
|
@ -13,7 +13,7 @@ func preload(db *gorm.DB, rels []*schema.Relationship, conds []interface{}) {
|
|||
var (
|
||||
reflectValue = db.Statement.ReflectValue
|
||||
rel = rels[len(rels)-1]
|
||||
tx = db.Session(&gorm.Session{NewDB: true})
|
||||
tx = db.Session(&gorm.Session{NewDB: true, SkipHooks: db.Statement.SkipHooks})
|
||||
relForeignKeys []string
|
||||
relForeignFields []*schema.Field
|
||||
foreignFields []*schema.Field
|
||||
|
|
Loading…
Reference in New Issue