How can you create a record with a hasMany
relationship with Ember-Data? This is my code so far:
var project = store.createRecord('project', {
name: 'foo',
organization: organizationModel,
managers: [userModel]
});
The organization
relationship gets filled in just fine, but the managers
relationship is always empty. I've also tried using an Ember.Set()
instead of an array, same issue. I've also tried leaving the managers
property out of the hash, and doing this instead:
project.set('managers', [userModel]);
That didn't work either an array or a set. How exactly am I supposed to fill in the hasMany relationship?