From c49e68fac25d58436f0c6fa530727c00766c5281 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Mon, 4 Apr 2016 20:57:42 +0800 Subject: [PATCH] Make Update works with unaddressable value --- field.go | 2 +- scope.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/field.go b/field.go index 87ef745b..bfaf00a3 100644 --- a/field.go +++ b/field.go @@ -54,5 +54,5 @@ func (field *Field) Set(value interface{}) (err error) { } field.IsBlank = isBlank(field.Field) - return nil + return err } diff --git a/scope.go b/scope.go index c5660681..075fc948 100644 --- a/scope.go +++ b/scope.go @@ -849,7 +849,7 @@ func (scope *Scope) updatedAttrsWithValues(value interface{}) (results map[strin field.Set(value) if field.IsNormal { hasUpdate = true - results[field.DBName] = field.Field.Interface() + results[field.DBName] = value } } }