{"action":"created","issue":{"url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/985","repository_url":"https://api.github.com/repos/Raizlabs/DBFlow","labels_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/985/labels{/name}","comments_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/985/comments","events_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/985/events","html_url":"https://github.com/Raizlabs/DBFlow/issues/985","id":177451709,"number":985,"title":"Update existing instance","user":{"login":"waclock","id":2390687,"avatar_url":"https://avatars.githubusercontent.com/u/2390687?v=3","gravatar_id":"","url":"https://api.github.com/users/waclock","html_url":"https://github.com/waclock","followers_url":"https://api.github.com/users/waclock/followers","following_url":"https://api.github.com/users/waclock/following{/other_user}","gists_url":"https://api.github.com/users/waclock/gists{/gist_id}","starred_url":"https://api.github.com/users/waclock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waclock/subscriptions","organizations_url":"https://api.github.com/users/waclock/orgs","repos_url":"https://api.github.com/users/waclock/repos","events_url":"https://api.github.com/users/waclock/events{/privacy}","received_events_url":"https://api.github.com/users/waclock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-16T15:18:29Z","updated_at":"2016-09-22T15:24:44Z","closed_at":null,"body":"I'm facing an issue trying to update an existing object in my DB.\r\n\r\nLet's say I have a User with certain columns with information (first name, last name, birthday).\r\n\r\nWhen I go to a specific activity, I send a request to the server, which responds with a User object (with the same PK), but only with the column image_url (no first name, last name, birthday this time).\r\n\r\nWhat I'd expect to happen if I did user.save() was to get a User containing first name, last name, birthday and image_url, however I'm ending up with a User with only image_url (and all other columns set as NULL).\r\n\r\nIs there a way to update only the new non-null columns on a object? The real case-scenario has some nested models that are received, which is why calling .save() actually saves more objects to the DB.\r\n\r\nThanks in advance\r\n"},"comment":{"url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/comments/248936623","html_url":"https://github.com/Raizlabs/DBFlow/issues/985#issuecomment-248936623","issue_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/985","id":248936623,"user":{"login":"waclock","id":2390687,"avatar_url":"https://avatars.githubusercontent.com/u/2390687?v=3","gravatar_id":"","url":"https://api.github.com/users/waclock","html_url":"https://github.com/waclock","followers_url":"https://api.github.com/users/waclock/followers","following_url":"https://api.github.com/users/waclock/following{/other_user}","gists_url":"https://api.github.com/users/waclock/gists{/gist_id}","starred_url":"https://api.github.com/users/waclock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waclock/subscriptions","organizations_url":"https://api.github.com/users/waclock/orgs","repos_url":"https://api.github.com/users/waclock/repos","events_url":"https://api.github.com/users/waclock/events{/privacy}","received_events_url":"https://api.github.com/users/waclock/received_events","type":"User","site_admin":false},"created_at":"2016-09-22T15:24:44Z","updated_at":"2016-09-22T15:24:44Z","body":"I gave it a shot, but I think I'm not following what should happen with the object created when parsing the server response. I'm currently using Retrofit with GSON converter, which generates a User object when I parse it.\r\n\r\nSince it's an Object, if the JSON only contained \"image_url\" the object generated will obviously only contain this attribute as a non-null value, however, all other attributes of the class will be null (as they were never initialized when the object was created).\r\n\r\nAm I missing something here? I'm not sure what's supposed to happen in order to \"merge\" both users. The first thing that comes to mind is first to perform a Search by the PK of the model, however I don't feel this is the correct way to proceed.\r\n\r\nIs there a way to just \"merge\" both users and ignore null values?"}}
{"actor":{"display_login":"waclock"}}