0
votes

In my app I have 'patients' that have a preferred 'clinic'. On the patient is a 'preferred_clinic_id' and a belongs_to relationship. How do I specify in ember data that a patient belongs to a clinic through the preferred_clinic_id? Thanks for your help.

Here is the rails relationship:

  belongs_to :preferred_clinic, class_name: 'Clinic`
1

1 Answers

1
votes
App.Patient = DS.Model.extend({
  preferred_clinic: DS.belongsTo('clinic', {inverse: null})
});
App.Clinic = DS.Model.extend({});