Skip to content

Commit

Permalink
Use Get to replace InstanceGet
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu committed May 19, 2015
1 parent dc55c59 commit c2dda88
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion callback_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Query(scope *Scope) {
}

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))
}

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (s *DB) Find(out interface{}, where ...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 {
Expand Down

0 comments on commit c2dda88

Please sign in to comment.