-
-
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
RESTSerializer.pushPayload does not allow sideloading of records #3090
Comments
You should remove the underscore in the payload or override Ember.String.pluralize('foo') == 'foos'. |
Quote from this page: "Support primary and sideloaded data of the same type to be returned from array lookups (via posts and _posts)." @fivetanley this looks like a regression? |
@amk221 You are correct. Sideloading secondary records of the same type as primary is supported in However, I'm unable to reproduce the error, see http://emberjs.jsbin.com/riyevivoxi/1/edit Would you be able to provide a JSBin demonstrating the error? |
Ah, you're right But, put that exact same code in a fresh ember-cli project (0.2.5) and it doesn't work |
I closed this a while ago, but realised it's still happening In a jsbin/fiddle/twiddle:
In an ember-cli app
|
This seem unrelated since the RESTSerializer removes the prefixing When does |
It's checking for the dash rather than an underscore? |
can you link to that code? |
Ah, sure: rest-serializer.js#pushPayload |
Ah, |
It was the same reason I mentioned in Slack earlier - if you manually Essentially I was expecting |
We discussed this issue at today's meeting and I'll have a look at this and see if/how we can implement this in a backwards compatible way. Should probably not be that hard.
👍 |
@pangratz Would this be covered by emberjs/rfcs#161? |
That RFC doesn't explicitly handle the inconsistencies between So I tend to think that this is a bug in |
Any update on this, it's been a long while |
Closing, as making changes to |
Oh dear. Does this mean I should be phasing this out of my app? If so, what
would I replace it with? Thanks
…On Fri, 16 Nov 2018 at 22:04, Chris Thoburn ***@***.***> wrote:
Closing, as making changes to pushPayload is not something we desire to
do, and because pushPayload requires too much "special sauce" and
"magical format knowledge" as it is.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3090 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAXUbQoap1lo_olWbzFAy7dOk52JEq3Bks5uvzZIgaJpZM4ElJby>
.
|
Given a payload like:
I get this warning:
WARNING: Encountered "_posts" in payload, but no model was found for model name "-post" (resolved model name using blah@serializer:post:.typeForRoot("_posts"))
1.0.0-beta.18
The text was updated successfully, but these errors were encountered: