jeudi 9 juillet 2015

How do you save a many-to-many relationship in Ember and Firebase

Let's say we have many medicines that can be prescribed to many patients. Our model would look like this:

App.Medicine = DS.Model.extend({
  name: DS.attr(),
  patients: DS.hasMany('user', { async: true }), 
});

App.User = DS.Model.extend({
  name: DS.attr(),
  medicines: DS.hasMany('medicine', { async: true })
});

In this scenario, how do we save records to a Firebase store?




Aucun commentaire:

Enregistrer un commentaire