1
votes

I have a Lead model defined with DS.Model and I noticed something weird when I was working with creating my app. When the REST resource doesn't return a resource in subsequent calls, the old data stays around. I tried to solve this by doing:

var model = this.get('model');
model.forEach(function(model) {
  model.destroy();
});

However, nothing happens. I have searched around but can't find the proper way to clear out a specific model cache and then refresh it with find(). I am using ember data 0.13

1
Clearing a model is tricky because of relationships, and isn't support at the moment. There is an discussion about it hereDarshan Sawardekar
I was afraid this would still be the case but figured there was a high probability. I was hoping that maybe something updated but I guess not.sb8244

1 Answers

0
votes

Please try this:

model.deleteRecord();