-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
polmorphic hasMany is not deserializing as correct type #1141
Comments
cc @cyril-sf |
Got it! elements_id rather than elements, but regardless.. all good. Thanks @hjdivad. Your cc of Cyril-sf lead me to that PR, which had everything I needed. |
No worries @lukegalea. Great job @cyril-sf: you seem to have fixed the problem without even showing up. wuwei. |
@lukegalea Great! Let us know if you have questions @hjdivad I like to solve problems in my sleep. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We have a form that has many elements. The has many association is polymorphic: true, but the corresponding belongs to is not as elements can only belong to a form.
There are several models that extend element (text and text area for instance).
All is well creating new text elements and adding to the elements array and saving, but when loading the data, all the elements are being deserialized as their base class (element).
Currently the form json contains element_ids, and a GET is triggered with the list of ids. This response contains a mix of different types, so the 'type' field is included in the response payload for each element.
How can Ember-Data be made to deserialize these into the correct classes?
The text was updated successfully, but these errors were encountered: