I’m using the new Ember-data 1.0.0 beta3 and have this issue (which I did not have with 13 revision!)
Giving two models with hasMany relationship
App.Post = Ember.Model.extend
title: DS.attr('string')
images: DS.hasMany('image', async:true)
App.Image = Ember.Model.extend
title: DS.attr('string')
I have a lot of images in the application and not necessary that one belongs to post. Then, I’m trying to push some images to Post from the controller (does not matter from where is this context)
assignImage: (image_id) ->
post = @get('controllers.post.content')
@store.find('image', image_id).then (image) =>
topic.get('images').addObject(image)
post.transitionTo('updated.uncommitted');
So far so good, I got a “Cancel” button active because, I have manually sent a Post to “isDirty” state, but the issue is, when I’m doing rollback()
discardChanges: (post) ->
if(post.get('isDirty'))
post.rollback()
I’m not getting the state before I have added the image, I’m mean: it is working fine for “title” but not for image_ids
Does any one know if it’s expecting behaviour?
And, btw why changing children records is not making parent ‘isDirty’ anymore…
Again: with rev13 was everything fine