Closed jsimonetti closed 8 years ago
This appears to be the case with all fields that need to be updated to default Go values
( update integer to 0, update string to "", etc)
Try using pointers in your Go structs. Then gorm can tell if it's nil or a zero-value.
I have actually seen that using the BuildsFrom DSL in your design, a new UpdateFromXPayload function is created. This function updates the database in a correct way. So this issues is resolved/non-existent for me. Just wanted to comment for future reading.
When a boolean type needs to be updated to false, this is not done by gorma. This is due to a problem in gorm. See https://github.com/jinzhu/gorm/issues/217#issuecomment-54419404 for a description of the problem and 3 possible solutions.
A solution to this inside gorma would be greatly appreciated.