Hello,
my models are defined as:
var Logbook = DS.Model.extend({
plate: DS.attr('string'),
mileageOrigin: DS.attr('number'),
entries : DS.hasMany('logentry',{async:true})
}
);
var Logentry = DS.Model.extend({
mileage: DS.attr('number'),
logbook: DS.belongsTo('logbook',{async : true}),
date: DS.attr('string'),
liter: DS.attr('number'),
price: DS.attr('number'),
notice: DS.attr('string')
}
);
The API response for Logbook is like this:
logbooks: [
{
Objectid: "76B312AC-182E-4179-9D67-6D3121480E6F",
mileageOrigin: 100002,
plate: "XY-AB 23"
}
]
So no attribute entries there. I try to write my own RESTAdapter and RESTSerializer for loading all logentries by loading a logbook, but it seems that all hooks (like extractFindHasMany or findhasMany) are do not trigger, because of the missing attribute.
Does anybody have a tip how to solve this problem? Where ist the best place to handle the relationship between those two models?
Thanks a lot (and sorry for my poor english)
Micha