Skip to content

Instantly share code, notes, and snippets.

@krishagel
Created March 18, 2014 23:35
Show Gist options
  • Save krishagel/9632291 to your computer and use it in GitHub Desktop.
Save krishagel/9632291 to your computer and use it in GitHub Desktop.
the following action:
deleteCategory: function() {
var self = this;
var removedCategory = this.get('model');
removedCategory.deleteRecord();
removedCategory.save().then(function(result) {
var org = removedCategory.get('organization');
org.get('categories').removeObject(result);
org.save().then(function() {
self.transitionToRoute('organization', org);
});
});
}
generates the following error:
Error: Assertion Failed: calling set on destroyed object
at new Error (native)
at Error.Ember.Error (http://localhost:8001/vendor/ember/ember.js:844:19)
at Object.Ember.assert (http://localhost:8001/vendor/ember/ember.js:73:11)
at set (http://localhost:8001/vendor/ember/ember.js:2969:9)
at Ember.Object.extend.hasManyDidChange (http://localhost:8001/vendor/ember-data/ember-data.js:5951:11)
at null.<anonymous> (http://localhost:8001/vendor/ember-data/ember-data.js:5940:18)
at http://localhost:8001/vendor/ember/ember.js:3368:16
at Object.OrderedSet.forEach (http://localhost:8001/vendor/ember/ember.js:3211:10)
at Object.Map.forEach (http://localhost:8001/vendor/ember/ember.js:3366:10)
at Ember.Object.extend.reloadHasManys (http://localhost:8001/vendor/ember-data/ember-data.js:5937:23) ember.js:3461
logToConsole ember.js:3461
Ember.RSVP.onerrorDefault ember.js:16897
__exports__.default.trigger ember.js:8717
Promise._onerror ember.js:9441
publishRejection ember.js:9848
DeferredActionQueues.flush ember.js:5893
Backburner.end ember.js:5984
Backburner.run ember.js:6023
Ember.run ember.js:6426
hash.success ember-data.js:1523
fire jquery.js:1037
self.fireWith jquery.js:1148
done jquery.js:8074
callback jquery.js:8598
Uncaught Error: Assertion Failed: Error: Assertion Failed: calling set on destroyed object ember.js:73
Ember.assert ember.js:73
Ember.RSVP.onerrorDefault ember.js:16898
__exports__.default.trigger ember.js:8717
Promise._onerror ember.js:9441
publishRejection ember.js:9848
DeferredActionQueues.flush ember.js:5893
Backburner.end ember.js:5984
Backburner.run ember.js:6023
Ember.run ember.js:6426
hash.success ember-data.js:1523
fire jquery.js:1037
self.fireWith jquery.js:1148
done jquery.js:8074
callback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment