{"action":"created","issue":{"url":"https://api.github.com/repos/emberjs/data/issues/4354","repository_url":"https://api.github.com/repos/emberjs/data","labels_url":"https://api.github.com/repos/emberjs/data/issues/4354/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/data/issues/4354/comments","events_url":"https://api.github.com/repos/emberjs/data/issues/4354/events","html_url":"https://github.com/emberjs/data/pull/4354","id":150717711,"number":4354,"title":"Add `include` param support for create/update/delete operations","user":{"login":"HeroicEric","id":602204,"avatar_url":"https://avatars.githubusercontent.com/u/602204?v=3","gravatar_id":"","url":"https://api.github.com/users/HeroicEric","html_url":"https://github.com/HeroicEric","followers_url":"https://api.github.com/users/HeroicEric/followers","following_url":"https://api.github.com/users/HeroicEric/following{/other_user}","gists_url":"https://api.github.com/users/HeroicEric/gists{/gist_id}","starred_url":"https://api.github.com/users/HeroicEric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeroicEric/subscriptions","organizations_url":"https://api.github.com/users/HeroicEric/orgs","repos_url":"https://api.github.com/users/HeroicEric/repos","events_url":"https://api.github.com/users/HeroicEric/events{/privacy}","received_events_url":"https://api.github.com/users/HeroicEric/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-25T00:34:03Z","updated_at":"2016-04-28T15:36:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/emberjs/data/pulls/4354","html_url":"https://github.com/emberjs/data/pull/4354","diff_url":"https://github.com/emberjs/data/pull/4354.diff","patch_url":"https://github.com/emberjs/data/pull/4354.patch"},"body":"Fixes https://github.com/emberjs/data/issues/4344\r\n\r\nSorry, @cibernox. I worked on this on a plane and did not realize you had already started working on it. I will post this here so maybe we can together come up with the best solution 😄 \r\n\r\nFor reference, https://github.com/emberjs/data/pull/4353 is the PR from @cibernox \r\n\r\nI do have the same question as you mentioned in the #dev-ember-data about whether or not this param belongs in the URL or request body. I decided to keep the implementation similar to the `findRecord` and `findAll` and delegate the decision to `$.ajax`.\r\n\r\nYou went one way and I went the other 😺 .\r\n\r\nThis allows an `include` parameter to be specified when creating,\r\nupdating, or deleting a model.\r\n\r\nThis feature was originally discussed in\r\nhttps://github.com/emberjs/rfcs/pull/99 but was not part of the initial\r\nimplementation.\r\n\r\nExamples:\r\n\r\n```javascript\r\n// Create\r\nlet post = this.store.createRecord('post', { title: 'Hurray' });\r\n\r\npost.save({ include: 'author' });\r\n\r\n// POST /posts\r\n//\r\n// data: {\r\n//   post: { title: 'Hurray' },\r\n//   include: 'author'\r\n// }\r\n```\r\n\r\n```javascript\r\n// Update\r\nlet post = this.store.peekRecord('post', 123);\r\n\r\nset(post, 'title', 'Hurray');\r\n\r\npost.save({ include: 'comments' });\r\n\r\n// PUT /posts/123\r\n//\r\n// data: {\r\n//   post: { title: 'Hurray' },\r\n//   include: 'comments'\r\n// }\r\n```\r\n\r\n```javascript\r\n// Delete\r\nlet post = this.store.peekRecord('post', 123);\r\n\r\npost.deleteRecord();\r\n\r\npost.save({ include: 'comments' });\r\n\r\n// DEL /posts/123\r\n//\r\n// data: {\r\n//   include: 'comments'\r\n// }\r\n```"},"comment":{"url":"https://api.github.com/repos/emberjs/data/issues/comments/215469830","html_url":"https://github.com/emberjs/data/pull/4354#issuecomment-215469830","issue_url":"https://api.github.com/repos/emberjs/data/issues/4354","id":215469830,"user":{"login":"dgeb","id":29122,"avatar_url":"https://avatars.githubusercontent.com/u/29122?v=3","gravatar_id":"","url":"https://api.github.com/users/dgeb","html_url":"https://github.com/dgeb","followers_url":"https://api.github.com/users/dgeb/followers","following_url":"https://api.github.com/users/dgeb/following{/other_user}","gists_url":"https://api.github.com/users/dgeb/gists{/gist_id}","starred_url":"https://api.github.com/users/dgeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgeb/subscriptions","organizations_url":"https://api.github.com/users/dgeb/orgs","repos_url":"https://api.github.com/users/dgeb/repos","events_url":"https://api.github.com/users/dgeb/events{/privacy}","received_events_url":"https://api.github.com/users/dgeb/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T15:36:56Z","updated_at":"2016-04-28T15:36:56Z","body":"> My understanding is the include parameter should always be a query parameter and it should not be included in the payload body\r\n\r\nThat's correct. Adding `include` to the request document does not conform to the spec."}}