{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/data/issues/4067","repository_url":"https://api.github.com/repos/emberjs/data","labels_url":"https://api.github.com/repos/emberjs/data/issues/4067/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/data/issues/4067/comments","events_url":"https://api.github.com/repos/emberjs/data/issues/4067/events","html_url":"https://github.com/emberjs/data/issues/4067","id":126286375,"number":4067,"title":"Saving a record removes associations locally","user":{"login":"thejbsmith","id":408512,"avatar_url":"https://avatars.githubusercontent.com/u/408512?v=3","gravatar_id":"","url":"https://api.github.com/users/thejbsmith","html_url":"https://github.com/thejbsmith","followers_url":"https://api.github.com/users/thejbsmith/followers","following_url":"https://api.github.com/users/thejbsmith/following{/other_user}","gists_url":"https://api.github.com/users/thejbsmith/gists{/gist_id}","starred_url":"https://api.github.com/users/thejbsmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thejbsmith/subscriptions","organizations_url":"https://api.github.com/users/thejbsmith/orgs","repos_url":"https://api.github.com/users/thejbsmith/repos","events_url":"https://api.github.com/users/thejbsmith/events{/privacy}","received_events_url":"https://api.github.com/users/thejbsmith/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-01-12T21:56:55Z","updated_at":"2016-10-21T23:38:31Z","closed_at":"2016-10-21T23:38:31Z","body":"I have an Ember app using the jsonapi adapter, with a Rails backend using the jsonapi-resources gem.\r\n\r\nIn my ember app, I create a record (with an association), then save the record, and then try to interact with the record. At this point, the association is no longer available locally and must be pulled from another request.\r\nAlthough the association is no longer available locally, the answerId attribute is available locally and has been set correctly since this is just an attribute instead of an association.\r\n```\r\nlet answer = ...;\r\n\r\nlet surveyAnswer = store.createRecord('survey-answer', {\r\n  ...\r\n  answer: answer,\r\n  ...\r\n});\r\n\r\n// surveyAnswer.answer is properly set here\r\n\r\nsurveyAnswer.save()\r\n.then( function(result){\r\n  // result.answer is not available locally and another request must be made to retrieve the answer\r\n}, function(error){\r\n  ...\r\n});\r\n```\r\n\r\nThis Ember app has a very large dataset, so we are trying to minimize requests as much as possible. We have not set up a backend controller to handle an Answer, since they are expected to be side-loaded wherever they are needed.\r\n\r\nIn this instance, why does the returned result no longer have a an answer associated with it? Am I missing something here? Does the save call to the server need to somehow specify what to include when the result is returned?\r\n\r\n-------------------------------\r\n\r\nEmber      : 2.2.0\r\nEmber Data : 2.2.1\r\njQuery     : 1.8.3\r\n\r\n-------------------------------"},"comment":{"url":"https://api.github.com/repos/emberjs/data/issues/comments/255489795","html_url":"https://github.com/emberjs/data/issues/4067#issuecomment-255489795","issue_url":"https://api.github.com/repos/emberjs/data/issues/4067","id":255489795,"user":{"login":"pangratz","id":341877,"avatar_url":"https://avatars.githubusercontent.com/u/341877?v=3","gravatar_id":"","url":"https://api.github.com/users/pangratz","html_url":"https://github.com/pangratz","followers_url":"https://api.github.com/users/pangratz/followers","following_url":"https://api.github.com/users/pangratz/following{/other_user}","gists_url":"https://api.github.com/users/pangratz/gists{/gist_id}","starred_url":"https://api.github.com/users/pangratz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pangratz/subscriptions","organizations_url":"https://api.github.com/users/pangratz/orgs","repos_url":"https://api.github.com/users/pangratz/repos","events_url":"https://api.github.com/users/pangratz/events{/privacy}","received_events_url":"https://api.github.com/users/pangratz/received_events","type":"User","site_admin":false},"created_at":"2016-10-21T23:38:31Z","updated_at":"2016-10-21T23:38:31Z","body":"@thejbsmith It has been a while. I really think that Resource Linkage helps in your case.\r\n\r\nPlease feel free to reopen if you disagree and think that this is still an issue.\r\n\r\nThanks!"}}
{"actor":{"display_login":"pangratz"}}