ember-parse-adapter icon indicating copy to clipboard operation
ember-parse-adapter copied to clipboard

How to use Array for the "one" in one-to-many relations?

Open igorsantos07 opened this issue 9 years ago • 0 comments

I have a model with a belongsTo relation, that in Parse is an Array column.

However, using model.set('column', [relationModel]) triggers an error: "Assertion Failed: You cannot add a 'undefined' record to the 'hypothesis.risk'. You can only add a 'item' record to this relationship."

I guess this happens because the belongsTo relation specify a model class, but how should we specify those instead? I wanted to use an Array column for a one-to-many relation, so it would load the "one" side instantly - instead of using Pointer, that would make a second request to get the "one" (this is advised in the parse docs).

igorsantos07 avatar Apr 25 '15 18:04 igorsantos07