Make Update works with unaddressable value

This commit is contained in:
Jinzhu 2016-04-04 20:57:42 +08:00
parent 2530dcbccd
commit c49e68fac2
2 changed files with 2 additions and 2 deletions

View File

@ -54,5 +54,5 @@ func (field *Field) Set(value interface{}) (err error) {
} }
field.IsBlank = isBlank(field.Field) field.IsBlank = isBlank(field.Field)
return nil return err
} }

View File

@ -849,7 +849,7 @@ func (scope *Scope) updatedAttrsWithValues(value interface{}) (results map[strin
field.Set(value) field.Set(value)
if field.IsNormal { if field.IsNormal {
hasUpdate = true hasUpdate = true
results[field.DBName] = field.Field.Interface() results[field.DBName] = value
} }
} }
} }