From 922395c965d33f00c7ea19718da2e285a403084d Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Mon, 25 Aug 2014 17:10:46 +0800 Subject: [PATCH] Add InstantSet for DB --- main.go | 4 ++-- scope.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index f1eaff3e..811a1d14 100644 --- a/main.go +++ b/main.go @@ -392,10 +392,10 @@ func (s *DB) Association(column string) *Association { // Set set value by name func (s *DB) Set(name string, value interface{}) *DB { - return s.clone().set(name, value) + return s.clone().InstantSet(name, value) } -func (s *DB) set(name string, value interface{}) *DB { +func (s *DB) InstantSet(name string, value interface{}) *DB { s.values[name] = value return s } diff --git a/scope.go b/scope.go index bf17e704..eba08520 100644 --- a/scope.go +++ b/scope.go @@ -364,7 +364,7 @@ func (scope *Scope) Exec() *Scope { // Set set value by name func (scope *Scope) Set(name string, value interface{}) *Scope { - scope.db.set(name, value) + scope.db.InstantSet(name, value) return scope }