{"action":"created","issue":{"url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/937","repository_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage","labels_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/937/labels{/name}","comments_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/937/comments","events_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/937/events","html_url":"https://github.com/samselikoff/ember-cli-mirage/issues/937","id":186495222,"number":937,"title":"Override response for included models","user":{"login":"Leooo","id":2422936,"avatar_url":"https://avatars2.githubusercontent.com/u/2422936?v=4","gravatar_id":"","url":"https://api.github.com/users/Leooo","html_url":"https://github.com/Leooo","followers_url":"https://api.github.com/users/Leooo/followers","following_url":"https://api.github.com/users/Leooo/following{/other_user}","gists_url":"https://api.github.com/users/Leooo/gists{/gist_id}","starred_url":"https://api.github.com/users/Leooo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Leooo/subscriptions","organizations_url":"https://api.github.com/users/Leooo/orgs","repos_url":"https://api.github.com/users/Leooo/repos","events_url":"https://api.github.com/users/Leooo/events{/privacy}","received_events_url":"https://api.github.com/users/Leooo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-01T09:48:58Z","updated_at":"2018-05-03T00:11:56Z","closed_at":"2018-05-03T00:11:56Z","author_association":"CONTRIBUTOR","body":"Probably not a priority, but still worth mentioning:\r\n\r\nI have a case where I want to include the `child` model in the `parent` response, and also override the `child` (included) response to add `links` in its payload.\r\n\r\nI found that, instead of just overriding the `serialize` method of the child, I had to:\r\n\r\n1) override the `getHashForIncludedResource` method of the parent serializer to use `lookupSerializer=true` in the `serializer.getHashForResource` function call\r\n\r\n2) override the `getHashForResource` of the child serializer to add my links.\r\n\r\nPretty indirect, I think at least this line should be changed in the `getHashForIncludedResource` method:\r\nfrom:\r\n`let [ hash, addToIncludes ] = serializer.getHashForResource(resource);`\r\nto:\r\n`let [ hash, addToIncludes ] = serializer.getHashForResource(resource, false, {}, true);`"},"comment":{"url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/comments/386158886","html_url":"https://github.com/samselikoff/ember-cli-mirage/issues/937#issuecomment-386158886","issue_url":"https://api.github.com/repos/samselikoff/ember-cli-mirage/issues/937","id":386158886,"user":{"login":"samselikoff","id":2922250,"avatar_url":"https://avatars1.githubusercontent.com/u/2922250?v=4","gravatar_id":"","url":"https://api.github.com/users/samselikoff","html_url":"https://github.com/samselikoff","followers_url":"https://api.github.com/users/samselikoff/followers","following_url":"https://api.github.com/users/samselikoff/following{/other_user}","gists_url":"https://api.github.com/users/samselikoff/gists{/gist_id}","starred_url":"https://api.github.com/users/samselikoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samselikoff/subscriptions","organizations_url":"https://api.github.com/users/samselikoff/orgs","repos_url":"https://api.github.com/users/samselikoff/repos","events_url":"https://api.github.com/users/samselikoff/events{/privacy}","received_events_url":"https://api.github.com/users/samselikoff/received_events","type":"User","site_admin":false},"created_at":"2018-05-03T00:11:56Z","updated_at":"2018-05-03T00:11:56Z","author_association":"OWNER","body":"I apologize for not responding to this!\r\n\r\nI’m trying to get back on top of issues, so for now I’ll go ahead and close this issue since it's quite old.\r\n\r\nIf you’re still having trouble, please ping me here or on slack @samselikoff and I’ll be happy to reopen + discuss."}}
{"actor":{"display_login":"samselikoff"}}