{"action":"created","comment":{"url":"https://api.github.com/repos/emberjs/guides/pulls/comments/39658700","id":39658700,"diff_hunk":"@@ -0,0 +1,240 @@\n+In Ember Data, the logic for communicating with a backend data store\n+lives in the `Adapter`. Ember Data's Adapter has some built-in\n+assumptions of how a [REST API](http://jsonapi.org/) should look. If\n+your backend conventions differ from these assumptions Ember Data\n+makes it easy to change its functionality by swapping out or extending\n+the default Adapter.\n+\n+Some reasons for customizing an Adapter include using\n+`underscores_case` in your urls, using a medium other than REST to\n+communicate with your backend API or even using a\n+[local backend](https://github.com/rpflorence/ember-localstorage-adapter).\n+\n+Extending Adapters is a natural process in Ember Data. Ember takes the\n+position that you should extend an adapter to add different\n+functionality instead of adding a flag. This results in code that is\n+more testable, easier to understand and reduces bloat for people who\n+may want to subclass your adapter.\n+\n+If your backend has some consistent rules you can define an\n+`adapter:application`. The `adapter:application` will get priority over\n+the default Adapter, however it will still be superseded by model\n+specific Adapters.\n+\n+```app/adapters/application.js\n+export default DS.RESTAdapter.extend({\n+  // Application specific overrides go here\n+});\n+```\n+\n+If you have one model that has exceptional rules for communicating\n+with its backend than the others you can create a Model specific\n+Adapter by running the command `ember generate adapter adapter-name`\".\n+For example, running `ember generate adapter post` will create the\n+following file:\n+\n+```app/adapters/post.js\n+export default DS.RESTAdapter.extend({\n+  namespace: 'api/v1'\n+});\n+```\n+\n+By default Ember Data comes with several builtin adapters. Feel free\n+to use these adapters as a starting point for creating your own custom\n+adapter.\n+\n+- [DS.Adapter](http://emberjs.com/api/data/classes/DS.Adapter.html) is the basic adapter\n+with no functionality. It is generally a good starting point if you\n+want to create an adapter that is radically different from the other\n+Ember adapters.\n+\n+- [DS.JSONAPIAdapter](http://emberjs.com/api/data/classes/DS.JSONAPIAdapter.html)\n+The `JSONAdapter` is the default adapter and follows JSON API\n+conventions to communicate with an HTTP server by transmitting JSON\n+via XHR.\n+\n+- [DS.RESTAdapter](http://emberjs.com/api/data/classes/DS.RESTAdapter.html)\n+The `RESTAdapter` allows your store to communicate with an HTTP server\n+by transmitting JSON via XHR. Before Ember Data 2.0 this adapter was the default.\n+\n+\n+## Customizing the JSONAPIAdapter\n+\n+The\n+[DS.JSONAPIAdapter](http://emberjs.com/api/data/classes/DS.JSONAdapter.html)\n+has a handful of hooks that are commonly used to extend it to work\n+with non-standard backends.\n+\n+### URL Conventions\n+\n+The `JSONAPIAdapter` is smart enough to determine the URLs it\n+communicates with based on the name of the model. For example, if you\n+ask for a `Post` by ID:\n+\n+```js\n+store.find('post', 1).then(function(post) {\n+});\n+```\n+\n+The REST adapter will automatically send a `GET` request to `/posts/1`.","path":"source/models/customizing-adapters.md","position":79,"original_position":79,"commit_id":"2778d38bb9d99e5300ffaa869c0f6d2af6013146","original_commit_id":"2778d38bb9d99e5300ffaa869c0f6d2af6013146","user":{"login":"wecc","id":708205,"avatar_url":"https://avatars.githubusercontent.com/u/708205?v=3","gravatar_id":"","url":"https://api.github.com/users/wecc","html_url":"https://github.com/wecc","followers_url":"https://api.github.com/users/wecc/followers","following_url":"https://api.github.com/users/wecc/following{/other_user}","gists_url":"https://api.github.com/users/wecc/gists{/gist_id}","starred_url":"https://api.github.com/users/wecc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wecc/subscriptions","organizations_url":"https://api.github.com/users/wecc/orgs","repos_url":"https://api.github.com/users/wecc/repos","events_url":"https://api.github.com/users/wecc/events{/privacy}","received_events_url":"https://api.github.com/users/wecc/received_events","type":"User","site_admin":false},"body":"\"The REST adapter\" => \"The adapter\"?","created_at":"2015-09-16T17:21:38Z","updated_at":"2015-09-16T17:21:38Z","html_url":"https://github.com/emberjs/guides/pull/733#discussion_r39658700","pull_request_url":"https://api.github.com/repos/emberjs/guides/pulls/733","_links":{"self":{"href":"https://api.github.com/repos/emberjs/guides/pulls/comments/39658700"},"html":{"href":"https://github.com/emberjs/guides/pull/733#discussion_r39658700"},"pull_request":{"href":"https://api.github.com/repos/emberjs/guides/pulls/733"}}},"pull_request":{"url":"https://api.github.com/repos/emberjs/guides/pulls/733","id":44951406,"html_url":"https://github.com/emberjs/guides/pull/733","diff_url":"https://github.com/emberjs/guides/pull/733.diff","patch_url":"https://github.com/emberjs/guides/pull/733.patch","issue_url":"https://api.github.com/repos/emberjs/guides/issues/733","number":733,"state":"open","locked":false,"title":"WIP Update the Models section of the guides","user":{"login":"bmac","id":54056,"avatar_url":"https://avatars.githubusercontent.com/u/54056?v=3","gravatar_id":"","url":"https://api.github.com/users/bmac","html_url":"https://github.com/bmac","followers_url":"https://api.github.com/users/bmac/followers","following_url":"https://api.github.com/users/bmac/following{/other_user}","gists_url":"https://api.github.com/users/bmac/gists{/gist_id}","starred_url":"https://api.github.com/users/bmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmac/subscriptions","organizations_url":"https://api.github.com/users/bmac/orgs","repos_url":"https://api.github.com/users/bmac/repos","events_url":"https://api.github.com/users/bmac/events{/privacy}","received_events_url":"https://api.github.com/users/bmac/received_events","type":"User","site_admin":false},"body":"cc @locks @michaelrkn @igorT ","created_at":"2015-09-14T16:31:14Z","updated_at":"2015-09-16T17:21:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"37c5ebda2deca184a63771b0b7ea9cf2ef75ae6d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/emberjs/guides/pulls/733/commits","review_comments_url":"https://api.github.com/repos/emberjs/guides/pulls/733/comments","review_comment_url":"https://api.github.com/repos/emberjs/guides/pulls/comments{/number}","comments_url":"https://api.github.com/repos/emberjs/guides/issues/733/comments","statuses_url":"https://api.github.com/repos/emberjs/guides/statuses/2778d38bb9d99e5300ffaa869c0f6d2af6013146","head":{"label":"bmac:update-models","ref":"update-models","sha":"2778d38bb9d99e5300ffaa869c0f6d2af6013146","user":{"login":"bmac","id":54056,"avatar_url":"https://avatars.githubusercontent.com/u/54056?v=3","gravatar_id":"","url":"https://api.github.com/users/bmac","html_url":"https://github.com/bmac","followers_url":"https://api.github.com/users/bmac/followers","following_url":"https://api.github.com/users/bmac/following{/other_user}","gists_url":"https://api.github.com/users/bmac/gists{/gist_id}","starred_url":"https://api.github.com/users/bmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmac/subscriptions","organizations_url":"https://api.github.com/users/bmac/orgs","repos_url":"https://api.github.com/users/bmac/repos","events_url":"https://api.github.com/users/bmac/events{/privacy}","received_events_url":"https://api.github.com/users/bmac/received_events","type":"User","site_admin":false},"repo":{"id":32989168,"name":"guides","full_name":"bmac/guides","owner":{"login":"bmac","id":54056,"avatar_url":"https://avatars.githubusercontent.com/u/54056?v=3","gravatar_id":"","url":"https://api.github.com/users/bmac","html_url":"https://github.com/bmac","followers_url":"https://api.github.com/users/bmac/followers","following_url":"https://api.github.com/users/bmac/following{/other_user}","gists_url":"https://api.github.com/users/bmac/gists{/gist_id}","starred_url":"https://api.github.com/users/bmac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmac/subscriptions","organizations_url":"https://api.github.com/users/bmac/orgs","repos_url":"https://api.github.com/users/bmac/repos","events_url":"https://api.github.com/users/bmac/events{/privacy}","received_events_url":"https://api.github.com/users/bmac/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bmac/guides","description":"The source for http://guides.emberjs.com","fork":true,"url":"https://api.github.com/repos/bmac/guides","forks_url":"https://api.github.com/repos/bmac/guides/forks","keys_url":"https://api.github.com/repos/bmac/guides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bmac/guides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bmac/guides/teams","hooks_url":"https://api.github.com/repos/bmac/guides/hooks","issue_events_url":"https://api.github.com/repos/bmac/guides/issues/events{/number}","events_url":"https://api.github.com/repos/bmac/guides/events","assignees_url":"https://api.github.com/repos/bmac/guides/assignees{/user}","branches_url":"https://api.github.com/repos/bmac/guides/branches{/branch}","tags_url":"https://api.github.com/repos/bmac/guides/tags","blobs_url":"https://api.github.com/repos/bmac/guides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bmac/guides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bmac/guides/git/refs{/sha}","trees_url":"https://api.github.com/repos/bmac/guides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bmac/guides/statuses/{sha}","languages_url":"https://api.github.com/repos/bmac/guides/languages","stargazers_url":"https://api.github.com/repos/bmac/guides/stargazers","contributors_url":"https://api.github.com/repos/bmac/guides/contributors","subscribers_url":"https://api.github.com/repos/bmac/guides/subscribers","subscription_url":"https://api.github.com/repos/bmac/guides/subscription","commits_url":"https://api.github.com/repos/bmac/guides/commits{/sha}","git_commits_url":"https://api.github.com/repos/bmac/guides/git/commits{/sha}","comments_url":"https://api.github.com/repos/bmac/guides/comments{/number}","issue_comment_url":"https://api.github.com/repos/bmac/guides/issues/comments{/number}","contents_url":"https://api.github.com/repos/bmac/guides/contents/{+path}","compare_url":"https://api.github.com/repos/bmac/guides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bmac/guides/merges","archive_url":"https://api.github.com/repos/bmac/guides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bmac/guides/downloads","issues_url":"https://api.github.com/repos/bmac/guides/issues{/number}","pulls_url":"https://api.github.com/repos/bmac/guides/pulls{/number}","milestones_url":"https://api.github.com/repos/bmac/guides/milestones{/number}","notifications_url":"https://api.github.com/repos/bmac/guides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bmac/guides/labels{/name}","releases_url":"https://api.github.com/repos/bmac/guides/releases{/id}","created_at":"2015-03-27T14:00:43Z","updated_at":"2015-04-28T13:14:43Z","pushed_at":"2015-09-14T16:30:06Z","git_url":"git://github.com/bmac/guides.git","ssh_url":"git@github.com:bmac/guides.git","clone_url":"https://github.com/bmac/guides.git","svn_url":"https://github.com/bmac/guides","homepage":null,"size":25345,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"emberjs:master","ref":"master","sha":"b82c833c99c208416338bcfe5c6133e2d92a52a2","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":22767401,"name":"guides","full_name":"emberjs/guides","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/guides","description":"The source for http://guides.emberjs.com","fork":false,"url":"https://api.github.com/repos/emberjs/guides","forks_url":"https://api.github.com/repos/emberjs/guides/forks","keys_url":"https://api.github.com/repos/emberjs/guides/keys{/key_id}","collaborators_url":"https://api.github.com/repos/emberjs/guides/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/emberjs/guides/teams","hooks_url":"https://api.github.com/repos/emberjs/guides/hooks","issue_events_url":"https://api.github.com/repos/emberjs/guides/issues/events{/number}","events_url":"https://api.github.com/repos/emberjs/guides/events","assignees_url":"https://api.github.com/repos/emberjs/guides/assignees{/user}","branches_url":"https://api.github.com/repos/emberjs/guides/branches{/branch}","tags_url":"https://api.github.com/repos/emberjs/guides/tags","blobs_url":"https://api.github.com/repos/emberjs/guides/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/emberjs/guides/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/emberjs/guides/git/refs{/sha}","trees_url":"https://api.github.com/repos/emberjs/guides/git/trees{/sha}","statuses_url":"https://api.github.com/repos/emberjs/guides/statuses/{sha}","languages_url":"https://api.github.com/repos/emberjs/guides/languages","stargazers_url":"https://api.github.com/repos/emberjs/guides/stargazers","contributors_url":"https://api.github.com/repos/emberjs/guides/contributors","subscribers_url":"https://api.github.com/repos/emberjs/guides/subscribers","subscription_url":"https://api.github.com/repos/emberjs/guides/subscription","commits_url":"https://api.github.com/repos/emberjs/guides/commits{/sha}","git_commits_url":"https://api.github.com/repos/emberjs/guides/git/commits{/sha}","comments_url":"https://api.github.com/repos/emberjs/guides/comments{/number}","issue_comment_url":"https://api.github.com/repos/emberjs/guides/issues/comments{/number}","contents_url":"https://api.github.com/repos/emberjs/guides/contents/{+path}","compare_url":"https://api.github.com/repos/emberjs/guides/compare/{base}...{head}","merges_url":"https://api.github.com/repos/emberjs/guides/merges","archive_url":"https://api.github.com/repos/emberjs/guides/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/emberjs/guides/downloads","issues_url":"https://api.github.com/repos/emberjs/guides/issues{/number}","pulls_url":"https://api.github.com/repos/emberjs/guides/pulls{/number}","milestones_url":"https://api.github.com/repos/emberjs/guides/milestones{/number}","notifications_url":"https://api.github.com/repos/emberjs/guides/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/emberjs/guides/labels{/name}","releases_url":"https://api.github.com/repos/emberjs/guides/releases{/id}","created_at":"2014-08-08T18:25:02Z","updated_at":"2015-09-15T18:07:35Z","pushed_at":"2015-09-16T14:08:22Z","git_url":"git://github.com/emberjs/guides.git","ssh_url":"git@github.com:emberjs/guides.git","clone_url":"https://github.com/emberjs/guides.git","svn_url":"https://github.com/emberjs/guides","homepage":null,"size":29849,"stargazers_count":130,"watchers_count":130,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":349,"mirror_url":null,"open_issues_count":41,"forks":349,"open_issues":41,"watchers":130,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/emberjs/guides/pulls/733"},"html":{"href":"https://github.com/emberjs/guides/pull/733"},"issue":{"href":"https://api.github.com/repos/emberjs/guides/issues/733"},"comments":{"href":"https://api.github.com/repos/emberjs/guides/issues/733/comments"},"review_comments":{"href":"https://api.github.com/repos/emberjs/guides/pulls/733/comments"},"review_comment":{"href":"https://api.github.com/repos/emberjs/guides/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/emberjs/guides/pulls/733/commits"},"statuses":{"href":"https://api.github.com/repos/emberjs/guides/statuses/2778d38bb9d99e5300ffaa869c0f6d2af6013146"}}}}