Reputation: 11571
I can not figure out how to delete a model created by App.store.createRecord()
.
Have a look at this fiddle: http://jsfiddle.net/Adw4F/2/
You can delete record loaded from fixtures (or rest adapter), but not created.
Upvotes: 5
Views: 1564
Reputation: 19902
You should be able to do:
record.deleteRecord({})
Or roll the transaction back.
Upvotes: 0
Reputation: 199
If you haven't commit'ed the record, all you need to do is rollback the transaction.
Ember uses a default transaction if one wasn't specified. For example:
record.get('transaction').rollback();
This will transition the record to the deleted state.
Upvotes: 2
Reputation: 9236
Using the very last version of ember-data, and adding a few (ugly|crappy|clumsy) things, I got it working. Obviously not ideal, but working...
See http://jsfiddle.net/MikeAski/Adw4F/32/
Upvotes: 1