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

Commit

Permalink
don’t override root collections when flattening linked
Browse files Browse the repository at this point in the history
  • Loading branch information
denisnazarov authored and raycohen committed Oct 1, 2014
1 parent 653120a commit a65cf1e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/json_api_serializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ DS.JsonApiSerializer = DS.RESTSerializer.extend({
}
}

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

delete linked[link];
}
delete payload.linked;
Expand Down

0 comments on commit a65cf1e

Please sign in to comment.