Skip to content
This repository has been archived by the owner on Oct 18, 2022. It is now read-only.

Commit

Permalink
build for bower v0.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
raycohen authored and kagemusha committed Nov 21, 2014
1 parent 9ec29af commit be1d00e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
21 changes: 14 additions & 7 deletions dist/ember-json-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ define("json-api-adapter",
/**
* Patch the extractSingle method, since there are no singular records
*/
extractSingle: function(store, primaryType, payload, recordId, requestType) {
extractSingle: function(store, primaryType, payload, recordId, requestType, record) {
var primaryTypeName;
if (this.keyForAttribute) {
primaryTypeName = this.keyForAttribute(primaryType.typeKey);
Expand All @@ -186,7 +186,7 @@ define("json-api-adapter",
json[key] = payload[key];
}
}
return this._super(store, primaryType, json, recordId, requestType);
return this._super(store, primaryType, json, recordId, requestType, record);
},

/**
Expand Down Expand Up @@ -227,17 +227,16 @@ define("json-api-adapter",
delete payload.links;
}
if (payload.linked) {
this.extractLinked(payload.linked);
delete payload.linked;
this.extractLinked(payload);
}
return payload;
},

/**
* Extract top-level "linked" containing associated objects
*/
extractLinked: function(linked) {
var link, values, value, relation;
extractLinked: function(payload) {
var link, values, value, relation, linked = payload.linked;
var store = get(this, 'store');

for (link in linked) {
Expand All @@ -252,8 +251,16 @@ define("json-api-adapter",
delete value.links;
}
}

if (payload[link]){
payload[link].pushObjects(linked[link]);
}else{
payload[link] = linked[link];
}

delete linked[link];
}
store.pushPayload(linked);
delete payload.linked;
},

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/ember-json-api.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit be1d00e

Please sign in to comment.