I have problem defining the relationship between my models in order to get cascading property. I would like to MapLineString to be deleted when Trail is deleted or Draw is deleted. But I DO NOT want Trail to be deleted when MapDraw or MapLineString gets deleted.
Relationship between the models is :
Trail can have one Trailer, one Team and one mapDraw
MapDraw can have many MapLineString
MapLineString can belongs to Trail AND/OR MapDraw
Trail = DS.Model.extend({
Trailer: DS.belongsTo('mapLinestring', {async: true, inverse: 'trail'}),
Team: DS.belongsTo('mapLinestring', {async: true, inverse: 'trail'}),
mapDraw: DS.belongsTo('mapDraw', {async: true}),
});
MapDraw = DS.Model.extend({
lineStrings: DS.hasMany('mapLinestring', {async: true}),
trail: DS.belongsTo('mtgTrail')
});
MapLineString = DS.Model.extend({
trail: DS.belongsTo('mtgTrail'),
mapDraw: DS.belongsTo('mapDraw'),
});
Assertion Failed: You defined the 'trail' relationship on mantrailling@model:map-linestring:, but you defined the inverse relationships of type mantrailling@model:mtg-trail: multiple times. Look at http://emberjs.com/guides/models/defining-models/#toc_explicit-inverses for how to explicitly specify inverses