Use Get to replace InstanceGet

This commit is contained in:
Jinzhu 2015-05-19 16:58:33 +08:00
parent dc55c59b84
commit c2dda88f9a
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ func Query(scope *Scope) {
} }
var dest = scope.IndirectValue() var dest = scope.IndirectValue()
if value, ok := scope.InstanceGet("gorm:query_destination"); ok { if value, ok := scope.Get("gorm:query_destination"); ok {
dest = reflect.Indirect(reflect.ValueOf(value)) dest = reflect.Indirect(reflect.ValueOf(value))
} }

View File

@ -212,7 +212,7 @@ func (s *DB) Find(out interface{}, where ...interface{}) *DB {
} }
func (s *DB) Scan(dest interface{}) *DB { func (s *DB) Scan(dest interface{}) *DB {
return s.clone().NewScope(s.Value).InstanceSet("gorm:query_destination", dest).callCallbacks(s.parent.callback.queries).db return s.clone().NewScope(s.Value).Set("gorm:query_destination", dest).callCallbacks(s.parent.callback.queries).db
} }
func (s *DB) Row() *sql.Row { func (s *DB) Row() *sql.Row {