Skip to content

Commit

Permalink
fix: include _id as the serialized pk when creating a record with id set
Browse files Browse the repository at this point in the history
  • Loading branch information
brunopedroso authored and gr2m committed May 3, 2017
1 parent 0b56b7f commit bec8d08
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions addon/adapters/hoodie.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ export default DS.Adapter.extend({
},

createRecord(store, type, snapshot) {
var props = this.serialize(snapshot);
if (snapshot.id) {
props.id = snapshot.id;
}
var props = this.serialize(snapshot, {includeId:true});
props.type = camelize(type.modelName);
return this._next(() => {
return this._hoodieStore().add(props);
Expand Down

0 comments on commit bec8d08

Please sign in to comment.