Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unloadRecord doesn't disconnect observers on the model #4126

Closed
jerel opened this issue Jan 28, 2016 · 3 comments
Closed

unloadRecord doesn't disconnect observers on the model #4126

jerel opened this issue Jan 28, 2016 · 3 comments

Comments

@jerel
Copy link

jerel commented Jan 28, 2016

Here is a twiddle demonstrating the problem (on canary): https://ember-twiddle.com/1523fd2fae4a21c261d7?numColumns=1&openFiles=models.event.js%2C

I have a scenario where a list of models is shown and each model is responsible for removing itself after it becomes old. However when unloadRecord is called the model is removed but the observers stay connected.

@alexspeller
Copy link
Contributor

it seems like unloadRecord doesn't actually destroy the record - no idea if this is intended or not, the workaround is just:

model.unloadRecord();
model.destroy();

@mitchlloyd
Copy link
Contributor

Perhaps this could be resolved with some updates to the current API documentation which is pretty sparse.

http://emberjs.com/api/data/classes/DS.Store.html#method_unloadAll

@wecc
Copy link
Contributor

wecc commented Oct 22, 2016

This should be fixed by #4593

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants