We have an Ember.js application that uses Ember data. We are trying to do the following:
- Delete entry.
- If a server error occurs (due to the fact that the application may have a “locked” state, when the records cannot be deleted), flip the record to the previous state, suggest the user to unlock the application and continue.
- If there is no server error, continue as usual.
We found that this does not work.
object.destroyRecord().then ->
, (reason)->
object.rollback()
In both cases, we see an error that looks like this:
Error: Assertion Failed: calling set on destroyed object
But it is unclear how to remove the state isDestroyedafter installing it.
, , , destroyRecord, , .