kurko / ember-indexeddb-adapter

Ember Data IndexedDB Adapter
MIT License
43 stars 16 forks source link

hasMany records are being duplicated #10

Closed kurko closed 10 years ago

kurko commented 10 years ago

For some reason, associations using this adapter are being duplicated.

cartItem = this.store.createRecord('cartItem', {
  price: inventoryItem.get('price'),
});

cart.get("cartItems").pushObject(cartItem);
console.log(cart.get("cartItems.length")); // => 1

cart.save().then(function(cart) {
  console.log(cart.get("cartItems.length")); // => 2, both with same ID
  cartItem.save();
});

This doesn't happen with RESTAdapter.

kurko commented 10 years ago

Actually this is not a bug on Ember Sync. It's somewhere else in my own app. There are test covering this.