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
No container in JSONSerializer #1741
Comments
And this is the reason why it is not cached during normal testing: https://github.com/emberjs/data/blob/master/tests/ember_configuration.js
|
@gonvaled what version of ED are you using and in what situation is this happening? |
Currently (painfully!) migrating to
And:
It could be that I am missing something when setting up the serializer. In that case, that should be clarified in the migration guide. |
No, that looks good, when/how does it explode? |
As soon as the first model is going to be serialized, with transform "string" (one of the standard transforms). I am trying to force the container manually on the serializer, to see what happens. Update: it worked:
|
I don't think it's correct to instantiate your serializer as this. I think it should be looked up via the container too. Or maybe you can just do SettingsApp.ApplicationSerialzer = SettingsApp.MetaRESTSerializer and don't define it in the Adapter declaration |
Similar to what @sly7-7 said, how are you registering the MetaRESTSerializer as your application's serializer? |
@sly7-7: do you have an example on how to do that? That was working for 0.0.14, and I see nothing in the transition guide regarding changes on the instantiation of the serializer. @bradleypriest : as you can see in Is there any complete example on how to use ember-data, including serializers/adapter/models. |
Ok, so you need to remove the "serializer" declaration from the adapter and define an App.ApplicationSerializer = MetaRESTSerializer instead. The transition doc has all the basic upgrading stuff, and the Models section of the official docs has some info. We're still lacking a bit so if there's parts missing, we'd love for you to help out. I'm gonna close this as it doesn't look like a bug, ping me if that doesn't work |
That is solving the issue, thanks! |
The
container
is undefined. Custom transforms are not working. This is probably related to pull request #1162.Also, there is no explicit test for
transformFor
.https://github.com/emberjs/data/blob/master/packages/ember-data/lib/serializers/json_serializer.js#L736:
The text was updated successfully, but these errors were encountered: