From c2dda88f9a8a0b5c73733e87689dc94cf2818fa2 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Tue, 19 May 2015 16:58:33 +0800 Subject: [PATCH] Use Get to replace InstanceGet --- callback_query.go | 2 +- main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/callback_query.go b/callback_query.go index 825caac1..59022eba 100644 --- a/callback_query.go +++ b/callback_query.go @@ -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)) } diff --git a/main.go b/main.go index 04f59bcf..bf8acbae 100644 --- a/main.go +++ b/main.go @@ -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 {