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 committed Oct 1, 2014
1 parent a65cf1e commit 30b1aed
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-json-api",
"version": "0.0.13",
"version": "0.0.14",
"homepage": "https://github.com/plyfe/ember-json-api",
"authors": [
"Dali Zheng <dali@series.ac>",
Expand All @@ -15,7 +15,7 @@
"tests"
],
"dependencies": {
"ember-data": "https://s3.amazonaws.com/asset-staging-playground/ember-data-1.0.0-patch-beta.10.tar.gz",
"ember-data": "https://s3.amazonaws.com/asset-staging-playground/ember-data-1.0.0-patch2-beta.10.tar.gz",
"ember": "v1.7.0"
},
"devDependencies": {
Expand Down
21 changes: 14 additions & 7 deletions dist/ember-json-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
/**
* 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 @@ -187,7 +187,7 @@
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 @@ -220,17 +220,16 @@
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 @@ -245,8 +244,16 @@
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 30b1aed

Please sign in to comment.