How should one update both sides of a many-to-many relationship?


I have two models that look a bit like this:

App.Book = DS.Model.extend({
  tags: DS.hasMany('tag')

App.Tag = DS.Model.extend({
  books: DS.hasMany('book', { async: true })

The problem is that when I add/remove a tag to/from a book and then save, the books property on the corresponding tag model is not updated. EDIT: After whipping up a JS Bin (, I’ve determined that this is happening because async is set to true. I’m not sure what to do here. A tag may have millions of books associated with it. If I’m not mistaken, then, setting async to false isn’t really an option, right? Then is there a way to refresh the association even with async set to true?

Btw, the way I’ve been adding/removing tags is as follows:'tag'), 123).then(function(tagToRemove) {
});'tag', 456).then(function(tagToAdd) {

Also of note: After adding/removing a tag to/from a book, calling book.get('isDirty') still returns false. Why?


@courtlandallen, do you have any updates on this?


Created an issue: