Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hasMany relations are not stored correctly #66

Open
igorsantos07 opened this issue Apr 27, 2015 · 2 comments
Open

hasMany relations are not stored correctly #66

igorsantos07 opened this issue Apr 27, 2015 · 2 comments
Labels

Comments

@igorsantos07
Copy link

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.
@blisst
Copy link

blisst commented Jul 8, 2015

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.

@igorsantos07
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants