Add InstantSet for DB

This commit is contained in:
Jinzhu 2014-08-25 17:10:46 +08:00
parent 3af077ac46
commit 922395c965
2 changed files with 3 additions and 3 deletions

View File

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

View File

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