Closed
Description
When creating a new item that belongs to a another resource, the parent resource doesn't seem to get updated with the relation.
Example:
DS.defineResource({
name: 'user',
relations: {
belongsTo: {
organization: {
localKey: 'organizationId',
localField: 'organization'
}
}
}
});
DS.defineResource({
name: 'organization',
relations: {
hasMany: {
user: {
localField: 'users',
foreignKey: 'organizationId'
}
}
}
});
Creating item
DS.create('users', { name: 'test', organizationId: 1}).then(function() {
DS.get('organization', 1); // This will not contain a relation to the newly created user
});