I've got two models of ember-data.
App.Component = DS.Model.extend({
componentGroup: DS.belongsTo('componentGroup', {async: true}),
name: DS.attr('string')
});
App.ComponentGroup = DS.Model.extend({
components: DS.hasMany('component', {async: true}),
name: DS.attr('string')
});
I am getting list of component_group and then when i click one of them i am trying to fetch all of components this group contains
Default behavior in ember-data beta 9 is to create n+1 get requests for getting that data. If i set
coalesceFindRequests: true
parameter, requests are merged into one but still using that huge array of ids. What i need is to ask API for giving all components that belongs to component_group with id X so rest call could look something like that
/component_group/X/components
It's more efficient when component group have a lot of children.
Is it possible somehow to achieve such behavior ?