According to the test implemented in ember-data, when we request child records from hasMany relationship, the store makes a get GET to child resources url and send the ids of needed child resources.
test("finding many people by a list of IDs", function() {
store.load(Group, { id: 1, people: [ 1, 2, 3 ] });
var group = store.find(Group, 1);
equal(ajaxUrl, undefined, "no Ajax calls have been made yet");
var people = get(group, 'people');
equal(get(people, 'length'), 3, "there are three people in the association already");
people.forEach(function(person) {
equal(get(person, 'isLoaded'), false, "the person is being loaded");
});
expectUrl("/people");
expectType("GET");
expectData({ ids: [ 1, 2, 3 ] });
How can I also send the id of the parent record (Group) ? My server need this id to retrieve the embbeded record. It need something like :
expectData({groud_id: the_group_id, ids: [1,2,3] })