{"action":"created","comment":{"url":"https://api.github.com/repos/emberjs/data/pulls/comments/46983902","id":46983902,"diff_hunk":"@@ -389,13 +403,19 @@ export default Adapter.extend(BuildURLMixin, {\n     @return {Promise} promise\n   */\n   findAll(store, type, sinceToken, snapshotRecordArray) {\n-    var query, url;\n+    const url = this.buildURL(type.modelName, null, null, 'findAll');\n+    const adapterOptions = snapshotRecordArray.adapterOptions || {};\n+    const { include } = adapterOptions;\n+\n+    let query;","path":"addon/adapters/rest-adapter.js","position":43,"original_position":43,"commit_id":"97193d0dcdc1d3b721a79f8b11ac0d2764bc5be0","original_commit_id":"97193d0dcdc1d3b721a79f8b11ac0d2764bc5be0","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},"body":"Sure","created_at":"2015-12-08T17:23:12Z","updated_at":"2015-12-08T17:23:12Z","html_url":"https://github.com/emberjs/data/pull/3976#discussion_r46983902","pull_request_url":"https://api.github.com/repos/emberjs/data/pulls/3976","_links":{"self":{"href":"https://api.github.com/repos/emberjs/data/pulls/comments/46983902"},"html":{"href":"https://github.com/emberjs/data/pull/3976#discussion_r46983902"},"pull_request":{"href":"https://api.github.com/repos/emberjs/data/pulls/3976"}}},"pull_request":{"url":"https://api.github.com/repos/emberjs/data/pulls/3976","id":52937677,"html_url":"https://github.com/emberjs/data/pull/3976","diff_url":"https://github.com/emberjs/data/pull/3976.diff","patch_url":"https://github.com/emberjs/data/pull/3976.patch","issue_url":"https://api.github.com/repos/emberjs/data/issues/3976","number":3976,"state":"open","locked":false,"title":"Allow `include` query parameter with store.findRecord & store.findAll","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},"body":"Related RFC: https://github.com/emberjs/rfcs/pull/99\r\n\r\n### Description\r\n\r\nThese changes allow an `include` paremeter to be specified when using\r\n`store.findRecord` and `store.findAll`:\r\n\r\n```javascript\r\nstore.findRecord('post', 123, { include: 'comments' });\r\nstore.findAll('post', { include: 'comments' });\r\n```\r\n\r\nThe value for `include` is copied into the `adapterOptions` that are\r\npassed to the corresponding adapter function as part of the `snapshot`\r\nor `snapshotRecordArray`. This value is then pulled from the snapshot\r\nand used as a query parameter (`include`) when making an AJAX request\r\nvia `adapter.ajax`.\r\n\r\n### Questions\r\n\r\n1. Is it OK that the `include` option is copied into `adapterOptions` or should it be copied into `adapterOptions.query`. I originally copied it into `adapterOptions.query` but the code was a little uglier so I went with just copying it into `adapterOptions`, but I'm still not sure.\r\n1. If the value for `include` is an array, should we automatically join the values into a comma separated list? The [JSON API spec for \"Inclusion of Related Resources\"](http://jsonapi.org/format/#fetching-includes) requires that the value be a comma separated list but I didn't think that was necessarily what everyone would want. We could just do that in the JSON API adapter but I figured I'd ask for some feedback before proceeding with that.\r\n\r\n### TODO\r\n\r\nIt was also [mentioned in the RFC](https://github.com/emberjs/rfcs/pull/99#issuecomment-153833942) that we could provide some additional functionality:\r\n\r\n```javascript\r\npost.save({ include: 'comments' });\r\npost.destroyRecord({ include: 'comments' });\r\n```\r\n\r\nI'm not totally clear on what the behavior would be there yet so those were left unimplemented for now.","created_at":"2015-12-08T04:38:33Z","updated_at":"2015-12-08T17:23:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7d9e91cede9a6741511c5e85262d3afc1521489","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/emberjs/data/pulls/3976/commits","review_comments_url":"https://api.github.com/repos/emberjs/data/pulls/3976/comments","review_comment_url":"https://api.github.com/repos/emberjs/data/pulls/comments{/number}","comments_url":"https://api.github.com/repos/emberjs/data/issues/3976/comments","statuses_url":"https://api.github.com/repos/emberjs/data/statuses/97193d0dcdc1d3b721a79f8b11ac0d2764bc5be0","head":{"label":"HeroicEric:allow-include","ref":"allow-include","sha":"97193d0dcdc1d3b721a79f8b11ac0d2764bc5be0","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},"repo":{"id":33514111,"name":"data","full_name":"HeroicEric/data","owner":{"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},"private":false,"html_url":"https://github.com/HeroicEric/data","description":"A data persistence library for Ember.js.","fork":true,"url":"https://api.github.com/repos/HeroicEric/data","forks_url":"https://api.github.com/repos/HeroicEric/data/forks","keys_url":"https://api.github.com/repos/HeroicEric/data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HeroicEric/data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HeroicEric/data/teams","hooks_url":"https://api.github.com/repos/HeroicEric/data/hooks","issue_events_url":"https://api.github.com/repos/HeroicEric/data/issues/events{/number}","events_url":"https://api.github.com/repos/HeroicEric/data/events","assignees_url":"https://api.github.com/repos/HeroicEric/data/assignees{/user}","branches_url":"https://api.github.com/repos/HeroicEric/data/branches{/branch}","tags_url":"https://api.github.com/repos/HeroicEric/data/tags","blobs_url":"https://api.github.com/repos/HeroicEric/data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HeroicEric/data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HeroicEric/data/git/refs{/sha}","trees_url":"https://api.github.com/repos/HeroicEric/data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HeroicEric/data/statuses/{sha}","languages_url":"https://api.github.com/repos/HeroicEric/data/languages","stargazers_url":"https://api.github.com/repos/HeroicEric/data/stargazers","contributors_url":"https://api.github.com/repos/HeroicEric/data/contributors","subscribers_url":"https://api.github.com/repos/HeroicEric/data/subscribers","subscription_url":"https://api.github.com/repos/HeroicEric/data/subscription","commits_url":"https://api.github.com/repos/HeroicEric/data/commits{/sha}","git_commits_url":"https://api.github.com/repos/HeroicEric/data/git/commits{/sha}","comments_url":"https://api.github.com/repos/HeroicEric/data/comments{/number}","issue_comment_url":"https://api.github.com/repos/HeroicEric/data/issues/comments{/number}","contents_url":"https://api.github.com/repos/HeroicEric/data/contents/{+path}","compare_url":"https://api.github.com/repos/HeroicEric/data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HeroicEric/data/merges","archive_url":"https://api.github.com/repos/HeroicEric/data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HeroicEric/data/downloads","issues_url":"https://api.github.com/repos/HeroicEric/data/issues{/number}","pulls_url":"https://api.github.com/repos/HeroicEric/data/pulls{/number}","milestones_url":"https://api.github.com/repos/HeroicEric/data/milestones{/number}","notifications_url":"https://api.github.com/repos/HeroicEric/data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HeroicEric/data/labels{/name}","releases_url":"https://api.github.com/repos/HeroicEric/data/releases{/id}","created_at":"2015-04-07T00:59:19Z","updated_at":"2015-04-07T00:59:21Z","pushed_at":"2015-12-08T04:30:51Z","git_url":"git://github.com/HeroicEric/data.git","ssh_url":"git@github.com:HeroicEric/data.git","clone_url":"https://github.com/HeroicEric/data.git","svn_url":"https://github.com/HeroicEric/data","homepage":"","size":10538,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"emberjs:master","ref":"master","sha":"41b203de5ab059ff46d4678bc30596d15c874e18","user":{"login":"emberjs","id":1253363,"avatar_url":"https://avatars.githubusercontent.com/u/1253363?v=3","gravatar_id":"","url":"https://api.github.com/users/emberjs","html_url":"https://github.com/emberjs","followers_url":"https://api.github.com/users/emberjs/followers","following_url":"https://api.github.com/users/emberjs/following{/other_user}","gists_url":"https://api.github.com/users/emberjs/gists{/gist_id}","starred_url":"https://api.github.com/users/emberjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emberjs/subscriptions","organizations_url":"https://api.github.com/users/emberjs/orgs","repos_url":"https://api.github.com/users/emberjs/repos","events_url":"https://api.github.com/users/emberjs/events{/privacy}","received_events_url":"https://api.github.com/users/emberjs/received_events","type":"Organization","site_admin":false},"repo":{"id":3016562,"name":"data","full_name":"emberjs/data","owner":{"login":"emberjs","id":1253363,"avatar_url":"https://avatars.githubusercontent.com/u/1253363?v=3","gravatar_id":"","url":"https://api.github.com/users/emberjs","html_url":"https://github.com/emberjs","followers_url":"https://api.github.com/users/emberjs/followers","following_url":"https://api.github.com/users/emberjs/following{/other_user}","gists_url":"https://api.github.com/users/emberjs/gists{/gist_id}","starred_url":"https://api.github.com/users/emberjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emberjs/subscriptions","organizations_url":"https://api.github.com/users/emberjs/orgs","repos_url":"https://api.github.com/users/emberjs/repos","events_url":"https://api.github.com/users/emberjs/events{/privacy}","received_events_url":"https://api.github.com/users/emberjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/emberjs/data","description":"A data persistence library for Ember.js.","fork":false,"url":"https://api.github.com/repos/emberjs/data","forks_url":"https://api.github.com/repos/emberjs/data/forks","keys_url":"https://api.github.com/repos/emberjs/data/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emberjs/data/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emberjs/data/teams","hooks_url":"https://api.github.com/repos/emberjs/data/hooks","issue_events_url":"https://api.github.com/repos/emberjs/data/issues/events{/number}","events_url":"https://api.github.com/repos/emberjs/data/events","assignees_url":"https://api.github.com/repos/emberjs/data/assignees{/user}","branches_url":"https://api.github.com/repos/emberjs/data/branches{/branch}","tags_url":"https://api.github.com/repos/emberjs/data/tags","blobs_url":"https://api.github.com/repos/emberjs/data/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emberjs/data/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emberjs/data/git/refs{/sha}","trees_url":"https://api.github.com/repos/emberjs/data/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emberjs/data/statuses/{sha}","languages_url":"https://api.github.com/repos/emberjs/data/languages","stargazers_url":"https://api.github.com/repos/emberjs/data/stargazers","contributors_url":"https://api.github.com/repos/emberjs/data/contributors","subscribers_url":"https://api.github.com/repos/emberjs/data/subscribers","subscription_url":"https://api.github.com/repos/emberjs/data/subscription","commits_url":"https://api.github.com/repos/emberjs/data/commits{/sha}","git_commits_url":"https://api.github.com/repos/emberjs/data/git/commits{/sha}","comments_url":"https://api.github.com/repos/emberjs/data/comments{/number}","issue_comment_url":"https://api.github.com/repos/emberjs/data/issues/comments{/number}","contents_url":"https://api.github.com/repos/emberjs/data/contents/{+path}","compare_url":"https://api.github.com/repos/emberjs/data/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emberjs/data/merges","archive_url":"https://api.github.com/repos/emberjs/data/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emberjs/data/downloads","issues_url":"https://api.github.com/repos/emberjs/data/issues{/number}","pulls_url":"https://api.github.com/repos/emberjs/data/pulls{/number}","milestones_url":"https://api.github.com/repos/emberjs/data/milestones{/number}","notifications_url":"https://api.github.com/repos/emberjs/data/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emberjs/data/labels{/name}","releases_url":"https://api.github.com/repos/emberjs/data/releases{/id}","created_at":"2011-12-20T01:50:40Z","updated_at":"2015-12-08T00:06:48Z","pushed_at":"2015-12-08T16:15:04Z","git_url":"git://github.com/emberjs/data.git","ssh_url":"git@github.com:emberjs/data.git","clone_url":"https://github.com/emberjs/data.git","svn_url":"https://github.com/emberjs/data","homepage":"","size":17267,"stargazers_count":2584,"watchers_count":2584,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":997,"mirror_url":null,"open_issues_count":262,"forks":997,"open_issues":262,"watchers":2584,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/emberjs/data/pulls/3976"},"html":{"href":"https://github.com/emberjs/data/pull/3976"},"issue":{"href":"https://api.github.com/repos/emberjs/data/issues/3976"},"comments":{"href":"https://api.github.com/repos/emberjs/data/issues/3976/comments"},"review_comments":{"href":"https://api.github.com/repos/emberjs/data/pulls/3976/comments"},"review_comment":{"href":"https://api.github.com/repos/emberjs/data/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/emberjs/data/pulls/3976/commits"},"statuses":{"href":"https://api.github.com/repos/emberjs/data/statuses/97193d0dcdc1d3b721a79f8b11ac0d2764bc5be0"}}}}