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

Error when saving record which has many children #51

Open
musnit opened this issue Feb 11, 2015 · 2 comments
Open

Error when saving record which has many children #51

musnit opened this issue Feb 11, 2015 · 2 comments

Comments

@musnit
Copy link

musnit commented Feb 11, 2015

When saving a record with many children, when serializing, an error is thrown in the serializeHasMany function of EmberParseAdapter.Serializer line 184.

      "className": child.parseClassName(),

The parseClassName function does not exist on the child record. This seems like an issue - is it supposed to be calling the parseClassName method on the serializer/adapter rather?

I got around this in my code by implementing a parseClassName method on my own model, which just returns the parse class name of that model.

Seems like a fix would be to change this line to call the parseClassName method on the serializer, rather than the non-existent method on the child model. Does that sound OK, or am I getting confused somewhere?

I'll make the fix if my solution sounds fine.

@igorsantos07
Copy link

+1 for this issue; this sounds big, too bad the maintainer gave up on the project...

It seems, giving my complete inexperience with Ember, that in this case Ember uses a snapshot of the Model instead of the actual class... That means the parseClassName() method won't exist in a snapshot.

@igorsantos07
Copy link

I think I got the issue... I'll be sending a PR soon

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

Successfully merging a pull request may close this issue.

2 participants