{"action":"created","issue":{"url":"https://api.github.com/repos/amiel/ember-data-url-templates/issues/10","labels_url":"https://api.github.com/repos/amiel/ember-data-url-templates/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/amiel/ember-data-url-templates/issues/10/comments","events_url":"https://api.github.com/repos/amiel/ember-data-url-templates/issues/10/events","html_url":"https://github.com/amiel/ember-data-url-templates/pull/10","id":119321155,"number":10,"title":"Remove re-implementation of pathForType","user":{"login":"drspaniel","id":1588273,"avatar_url":"https://avatars.githubusercontent.com/u/1588273?v=3","gravatar_id":"","url":"https://api.github.com/users/drspaniel","html_url":"https://github.com/drspaniel","followers_url":"https://api.github.com/users/drspaniel/followers","following_url":"https://api.github.com/users/drspaniel/following{/other_user}","gists_url":"https://api.github.com/users/drspaniel/gists{/gist_id}","starred_url":"https://api.github.com/users/drspaniel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drspaniel/subscriptions","organizations_url":"https://api.github.com/users/drspaniel/orgs","repos_url":"https://api.github.com/users/drspaniel/repos","events_url":"https://api.github.com/users/drspaniel/events{/privacy}","received_events_url":"https://api.github.com/users/drspaniel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-28T22:19:21Z","updated_at":"2015-12-01T00:48:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/amiel/ember-data-url-templates/pulls/10","html_url":"https://github.com/amiel/ember-data-url-templates/pull/10","diff_url":"https://github.com/amiel/ember-data-url-templates/pull/10.diff","patch_url":"https://github.com/amiel/ember-data-url-templates/pull/10.patch"},"body":"The default ember adapter pluralizes the model type:\r\nhttps://github.com/emberjs/data/blob/v2.2.1/packages/ember-data/lib/adapters/build-url-mixin.js#L280\r\nRe-implenting it in the mixin will clobber a user-specified path\r\nfunction from a super class. For example, this setup will\r\nerroneously pluralize the type:\r\n```js\r\n// application/adapter.js\r\nexport default DS.RESTAdapter.extend({\r\n  pathForType(type) {\r\n    return Ember.String.camelize(type);\r\n  }\r\n});\r\n\r\n// thing/adapter.js\r\nimport ApplicationAdapter from '../application/adapter.js';\r\nimport UrlTemplates from \"ember-data-url-templates\";\r\nexport default ApplicationAdapter.extend(UrlTemplates, {\r\n  urlTemplate: \"{+host}{/namespace}/{pathForType}{/id}\"\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/amiel/ember-data-url-templates/issues/comments/160811054","html_url":"https://github.com/amiel/ember-data-url-templates/pull/10#issuecomment-160811054","issue_url":"https://api.github.com/repos/amiel/ember-data-url-templates/issues/10","id":160811054,"user":{"login":"amiel","id":27160,"avatar_url":"https://avatars.githubusercontent.com/u/27160?v=3","gravatar_id":"","url":"https://api.github.com/users/amiel","html_url":"https://github.com/amiel","followers_url":"https://api.github.com/users/amiel/followers","following_url":"https://api.github.com/users/amiel/following{/other_user}","gists_url":"https://api.github.com/users/amiel/gists{/gist_id}","starred_url":"https://api.github.com/users/amiel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amiel/subscriptions","organizations_url":"https://api.github.com/users/amiel/orgs","repos_url":"https://api.github.com/users/amiel/repos","events_url":"https://api.github.com/users/amiel/events{/privacy}","received_events_url":"https://api.github.com/users/amiel/received_events","type":"User","site_admin":false},"created_at":"2015-12-01T00:48:43Z","updated_at":"2015-12-01T00:48:43Z","body":"This makes plenty of sense.\r\n\r\nNote that this will break for people directly using the [base system adapter](https://github.com/emberjs/data/blob/master/addon/system/adapter.js) nor the [RESTAdapter](https://github.com/emberjs/data/blob/master/addon/adapters/rest-adapter.js), as I don't think they implement `pathForType`.\r\n\r\nWould you:\r\n\r\n1. Rebase on master now that #9 is merged.\r\n2. At least look in to implementing `pathForType` with super and a deprecation warning. I'm thinking something like:\r\n\r\n   ```javascript\r\n   // I'm pretty sure a missing super will just return undefined as opposed to error\r\n   let pathForType = this._super(...); \r\n   if (pathForType) { return pathForType; }\r\n   // A deprecation warning and the original implementation. We will remove all of this in the 1.13 version.\r\n   ```"}}