mirror of https://github.com/go-gorm/gorm.git
Make Update works with unaddressable value
This commit is contained in:
parent
2530dcbccd
commit
c49e68fac2
2
field.go
2
field.go
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
2
scope.go
2
scope.go
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue