forked from mirror/gorm
Lazy call registered scopes
This commit is contained in:
parent
6b7d18656d
commit
ddeb143eb9
|
@ -482,8 +482,9 @@ func (stmt *Statement) clone() *Statement {
|
||||||
copy(newStmt.Joins, stmt.Joins)
|
copy(newStmt.Joins, stmt.Joins)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, scope := range stmt.scopes {
|
if len(stmt.scopes) > 0 {
|
||||||
stmt.scopes = append(stmt.scopes, scope)
|
newStmt.scopes = make([]func(*DB) *DB, len(stmt.scopes))
|
||||||
|
copy(newStmt.scopes, stmt.scopes)
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt.Settings.Range(func(k, v interface{}) bool {
|
stmt.Settings.Range(func(k, v interface{}) bool {
|
||||||
|
|
Loading…
Reference in New Issue