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

Changing a belongsTo property doesn't set the model's isDirty to true #2455

Closed
johnnyoshika opened this issue Nov 8, 2014 · 3 comments
Closed

Comments

@johnnyoshika
Copy link

Here's an example model:

App.Book = DS.Model.extend({
  title: DS.attr('string'),
  author: DS.belongsTo('author')
});

Changing the belongsTo property (author) should set the book's isDirty to true, but it doesn't. This also means that DS.Model.rollback() doesn't work. Here's a jsbin:

http://emberjs.jsbin.com/zifaqa/2/edit?html,js,output

@oneeman
Copy link

oneeman commented Nov 10, 2014

I'm not too familiar with the topic, but I've seen it discussed in other issues here. I believe the newest one is #2122 .
And some going further back with more information:
#1367 (with some discussion)
#1514 (with some possible solutions)

@bradleypriest
Copy link
Member

Thanks for your comments. Basically, tracking dirtiness across relationships is a non-trivial problem with often application-specific semantics.

That said we would love insights on suggestions to help pave the cowpaths.
Please feel free to add your thoughts on the other open issues or create a new discussion at https://discuss.emberjs.com

@timrwood
Copy link

I've opened an rfc for this issue here. Please weigh in.

emberjs/rfcs#21

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

4 participants