ember-parse-adapter
ember-parse-adapter copied to clipboard
Error when saving record which has many children
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.
+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.
I think I got the issue... I'll be sending a PR soon