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 (
|
var (
|
||||||
reflectValue = db.Statement.ReflectValue
|
reflectValue = db.Statement.ReflectValue
|
||||||
rel = rels[len(rels)-1]
|
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
|
relForeignKeys []string
|
||||||
relForeignFields []*schema.Field
|
relForeignFields []*schema.Field
|
||||||
foreignFields []*schema.Field
|
foreignFields []*schema.Field
|
||||||
|
|
Loading…
Reference in New Issue