From 7a99f37ba4cbbf4a2a623ca31e53966ad5c0383d Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Tue, 28 Jan 2014 10:29:12 +0800 Subject: [PATCH] Make exec works with plugin system --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 6bfb7c6d..43ce867e 100644 --- a/main.go +++ b/main.go @@ -207,7 +207,9 @@ func (s *DB) Raw(sql string, values ...interface{}) *DB { } func (s *DB) Exec(sql string, values ...interface{}) *DB { - return s.clone().do(nil).raw(sql, values...).exec().db + scope := s.clone().NewScope(nil) + scope.Raw(scope.buildWhereCondition(map[string]interface{}{"query": sql, "args": values})) + return scope.Exec().db } func (s *DB) Model(value interface{}) *DB {