In the app user has two associations - billing address and company address which are identical
//address
export default DS.Model.extend({
email: DS.attr('string'),
country: DS.attr('string'),
zip: DS.attr('string'),
user: DS.belongsTo('user')
//...
});
//user
export default DS.Model.extend({
name: DS.attr('string'),
company: DS.belongsTo('address'),
billing: DS.belongsTo('address')
//...
});
How to pull this kind of trick?
Aucun commentaire:
Enregistrer un commentaire