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

hasMany relations are not stored correctly

Open igorsantos07 opened this issue 9 years ago • 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.

igorsantos07 avatar Apr 27 '15 04:04 igorsantos07

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.

blisst avatar Jul 08 '15 05:07 blisst

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

igorsantos07 avatar Jul 10 '15 13:07 igorsantos07