Skip to content

Instantly share code, notes, and snippets.

@shreyansb
Created February 19, 2013 20:57
Show Gist options
  • Save shreyansb/4989834 to your computer and use it in GitHub Desktop.
Save shreyansb/4989834 to your computer and use it in GitHub Desktop.
trouble dirtying a hasMany associated field with pushObject
App.Video = DS.Model.extends({
responses: DS.hasMany('App.Video')
});
// in a controller
save: function() {
var v = this.get('model');
var r = App.Video.find(this.get('responseId'));
v.get('responses').pushObject(r);
console.log(v.get('isDirty')); // false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment