emberjs/data — Issue #148: Delete created uncommitted model
Author: jfgirard
Created: 2012-03-08 18:03:47+00:00
State: open

Hi,

I found an issue deleting a model created but not yet committed. The model move to state `deleted.saved` but is not remove from the model arrays. I not sure about the best way to fix that but one way is the following:

**ember-data/lib/system/model/states.js**

var CreatedUncommitted = Ember.Mixin.create({
deleteRecord: function(manager) {
this._super(manager);
//*** I added this
var model = get(manager, 'model');
var store = model.get('store');
store.removeFromModelArrays(model);
//*** end
manager.goToState('deleted.saved');
}
});

What do you think ?

Jeff