I have a problem setting belongsTo relationship on newly created record. Simply I have to objects:
Checklist with:
user: DS.belongsTo('user', {
async: true,
inverse: 'checklists'
})
User with:
checklists: DS.hasMany('checklist', {
async: true,
inverse: 'user'
})
I’m trying to create new checklist object:
var checklist = this.store.createRecord('checklist', {
name: this.get('checklistName'),
user: this.get('currentUser')
});
checklist.save();
Name is set up correctly from controller. currentUser keeps valid user object of course, however it’s not set. When the request hits API it lacks user parameter:
{
checklist: {
name: 'Name'
}
}
When I remove “async” parameter from checklist model it apparently works. What may cause that?