Using emberjs 1.5.1 and ember-data 1.0.0-beta.5. I have couple of models:
App.Queue = DS.Model.extend({
queue_id: attr('number', {}),
services: hasMany('service', {})
});
App.Service = DS.Model.extend({
queue: belongsTo('queue', {}),
service_id: attr('number', {}),
});
Here I create queue
instance, save it, then try to create service
instance and put created queue
in belongsTo
field
var new_queue = controller.store.createRecord('queue', {queue_id: element.Item1.Id});
new_queue.save();
var new_service = controller.store.createRecord('service', {
queue: new_queue,
service_id: subelement.Item1.Id,
});
new_service.save();
and after this I get new_service
instance with the queue
field equals undefined
. Any ideas appreciated