-
-
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
deprecation error when store.push(jsonApiDocument) #4372
Comments
Can you update this ember-twiddle so it demonstrates the issue you're having? |
Your fix of passing let otherPerson = store.peekRecord('person', 1);
store.push({
data: {
id: 2,
type: 'person',
relationships: {
siblings: {
data: [ otherPerson ]
}
}
}
}); Can you check if this is the case in your code? |
I've said above what I'm doing - importing a json-api document. Here's my app code:
|
PS we use peek...() to read from the store as we only have fixture data |
The payload you posted looks ok. Are you getting the error for the code above? I can reproduce your "cannot pass classes" error when the data pushed via |
Yes this is how we discovered it. My posited bodge fix does lose the error
|
I cannot reproduce the error you're getting, pushing the fixture data you provided, see this ember-twiddle. Can you take a look and see what is different to your case? |
@BryanCrotaz I'm inclined to close this issue as it cannot be reproduced. Also, the only way I see how the errors gets thrown, is if you pass a model instance somewhere in the payload passed to Please feel free to reopen if you can reproduce this bug. I definitely want to improve the experience here and maybe we can do that by a helpful assertion. Thanks! |
call store.push passing a json api document with a relationship inside it:
Error: cannot pass classes to modelFor, only classnames
Fix is in store.js
I need to work out how to test this before I can submit a PR
The text was updated successfully, but these errors were encountered: