Hi People,
I have two models:
App.Emotion = DS.Model.extend name: DS.attr(‘string’) statuses: DS.hasMany ‘status’, { async: true }
App.Status = DS.Model.extend body: DS.attr ‘string’ emotions: DS.hasMany ‘emotion’, { async: true } created_at: DS.attr ‘date’, { readOnly: true } updated_at: DS.attr ‘date’, { readOnly: true }
When I save the status, I’m getting the following result:
{“status”=>{“body”=>“labore et dolore magna aliquyam erat, sed diam voluptua.”, “created_at”=>nil, “updated_at”=>nil, “emotions”=>[{“name”=>“Test”, “statuses”=>nil, “id”=>“a87af1bb-de56-4092-ae52-e21bdd5efc14”}, {“name”=>“Test2”, “statuses”=>nil, “id”=>“117489c3-5ef3-476a-bdd1-8048b10d21be”}, {“name”=>“Test3”, “statuses”=>nil, “id”=>“721f0d0f-f7d5-48f3-94c7-2aa8fe3d2441”}]}}
Rails is expecting emotion_ids whats the best practise for handling many to many relationships in ember?