{"action":"opened","issue":{"url":"https://api.github.com/repos/jinzhu/gorm/issues/730","labels_url":"https://api.github.com/repos/jinzhu/gorm/issues/730/labels{/name}","comments_url":"https://api.github.com/repos/jinzhu/gorm/issues/730/comments","events_url":"https://api.github.com/repos/jinzhu/gorm/issues/730/events","html_url":"https://github.com/jinzhu/gorm/issues/730","id":117927764,"number":730,"title":"Updates not behaving as specified in the README","user":{"login":"collinglass","id":3614712,"avatar_url":"https://avatars.githubusercontent.com/u/3614712?v=3","gravatar_id":"","url":"https://api.github.com/users/collinglass","html_url":"https://github.com/collinglass","followers_url":"https://api.github.com/users/collinglass/followers","following_url":"https://api.github.com/users/collinglass/following{/other_user}","gists_url":"https://api.github.com/users/collinglass/gists{/gist_id}","starred_url":"https://api.github.com/users/collinglass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/collinglass/subscriptions","organizations_url":"https://api.github.com/users/collinglass/orgs","repos_url":"https://api.github.com/users/collinglass/repos","events_url":"https://api.github.com/users/collinglass/events{/privacy}","received_events_url":"https://api.github.com/users/collinglass/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-19T22:55:41Z","updated_at":"2015-11-19T22:55:41Z","closed_at":null,"body":"Hi,\r\n\r\nI'm trying to update my structs where only the non-zero values update. Like discussed in this issue (https://github.com/jinzhu/gorm/issues/202).\r\n\r\nI'm following the README, specifically:\r\n\r\n```\r\n// Update multiple attributes if they are changed (update with struct only works with none zero values)\r\ndb.Model(&user).Updates(User{Name: \"hello\", Age: 18})\r\n//// UPDATE users SET name='hello', age=18, updated_at = '2013-11-17 21:34:10' WHERE id = 111;\r\n```\r\n\r\nHere is my go code (print statements and all):\r\n\r\n```\r\nfunc Update(l interface{}) error {\r\n\tGetDB().LogMode(true)\r\n\tlocal := GetDB()\r\n\r\n\tswitch e := l.(type) {\r\n\tcase *User:\r\n\t\tfmt.Println(*e)\r\n\t\tlocal = local.Model(&User{}).Updates(*e)\r\n\tcase *Book:\r\n\t\tlocal = local.Model(&Book{}).Updates(*e)\r\n\tcase *Listing:\r\n\t\tlocal = local.Model(&Listing{}).Updates(*e)\r\n\t}\r\n\r\n\treturn local.Error\r\n}\r\n```\r\n\r\nI'm trying to update this struct:\r\n\r\nUser{ Id:6, Longitude:34.567890, Latitude:-97.123456 }\r\n\r\nThis is the generated SQL:\r\n```\r\nUPDATE \"users\" SET \"email\" = '', \"updated_at\" = '2015-11-19T17:40:50-05:00', \"stats\" = '<nil>', \"settings\" = '<nil>', \"created_at\" = '0001-01-01T00:00:00Z', \"longitude\" = '34.56789', \"latitude\" = '-97.123456', \"auth\" = '{ password_omitted }', \"profile\" = '<nil>'  WHERE (\"id\" = '6')\r\n```\r\n\r\nIt's pretty clear that the email with an empty string and nil fields are being sent."}}