Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary URL check in findHasMany #3021

Merged
merged 1 commit into from
Apr 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions packages/ember-data/lib/adapters/rest-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,6 @@ export default Adapter.extend(BuildURLMixin, {
This method will be called with the parent record and `/posts/1/comments`.

The `findHasMany` method will make an Ajax (HTTP GET) request to the originally specified URL.
If the URL is host-relative (starting with a single slash), the
request will use the host specified on the adapter (if any).

@method findHasMany
@param {DS.Store} store
Expand All @@ -468,14 +466,9 @@ export default Adapter.extend(BuildURLMixin, {
@return {Promise} promise
*/
findHasMany: function(store, snapshot, url, relationship) {
var host = get(this, 'host');
var id = snapshot.id;
var type = snapshot.typeKey;

if (host && url.charAt(0) === '/' && url.charAt(1) !== '/') {
url = host + url;
}

url = this.urlPrefix(url, this.buildURL(type, id, null, 'findHasMany'));

return this.ajax(url, 'GET');
Expand Down