clintjhill/ember-parse-adapter

hasMany relations are not stored correctly

Opened this issue · 2 comments

It seems the adapter has trouble when dealing with hasMany relations.

Namely, I created an Array column, but got 400 as the adapter sends in an OBJECT in place of a list of items.
Then I changed the column into type object. What's my surprise when Ember refuses to load my record since hasMany should be an array, not an object?

A (subclass of DS.Model) record was pushed into the store with the value of boards
being '{objects: [object Object]}', but boards is a hasMany relationship so the value
must be an array.

Was hasMany working for you in the first place?

I had to override the serializeHasMany method and change line 26 to 'objectId' : child.get( 'id' ) as opposed to 'objectId' : child.attr( 'id' ) to get your error in the first place.

Never worked, @blisst. I have tackled that on #76/#73. Take a look there :)