mirror of https://github.com/go-gorm/gorm.git
Use the original DB when create a new Scope
This commit is contained in:
parent
5347765bd3
commit
8f22434ded
2
scope.go
2
scope.go
|
@ -39,7 +39,7 @@ func (db *DB) NewScope(value interface{}) *Scope {
|
||||||
|
|
||||||
// New create a new Scope without search information
|
// New create a new Scope without search information
|
||||||
func (scope *Scope) New(value interface{}) *Scope {
|
func (scope *Scope) New(value interface{}) *Scope {
|
||||||
return &Scope{db: scope.db.parent, Search: &search{}, Value: value}
|
return &Scope{db: scope.db, Search: &search{}, Value: value}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewDB create a new DB without search information
|
// NewDB create a new DB without search information
|
||||||
|
|
Loading…
Reference in New Issue