forked from mirror/gorm
Don't preload when there are any error happened
This commit is contained in:
parent
c1bb8e4551
commit
a9f54d53fb
|
@ -206,10 +206,12 @@ func Preload(db *gorm.DB) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if db.Error == nil {
|
||||||
preload(db, rels, db.Statement.Preloads[name])
|
preload(db, rels, db.Statement.Preloads[name])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func AfterQuery(db *gorm.DB) {
|
func AfterQuery(db *gorm.DB) {
|
||||||
if db.Error == nil && db.Statement.Schema != nil && db.Statement.Schema.AfterFind {
|
if db.Error == nil && db.Statement.Schema != nil && db.Statement.Schema.AfterFind {
|
||||||
|
|
Loading…
Reference in New Issue