This looks like an Ember Data bug to me. I can reproduce.
The underlying explanation is that ans.question is allowed to load asynchronously, but when you say ans.question we need some placeholder object that stands in for the maybe-not-yet-loaded Question. Ember Data handles this with a proxy object. But the proxy object also has a built-in property named content, which is taking precedence over the field in your model.
To workaround, you can rename your content field to something else, like body. If you can’t easily change the server side, you can rename it within your app via a serialize:
// app/serializers/question.js
import DS from 'ember-data';
export default DS.JSONAPISerializer.extend({
attrs: {
// renames server's "content" field to "body" within our ember app, to avoid
// colliding with a built-in name in ember-data.
body: 'content'
}
});
Alternatively, this bug is not present if your question relationship is synchronous:
because in that case no proxy is needed. But this also requires that you take responsibility for guaranteeing that the question model is already loaded before you try to access it.
Thank you for your answer sir, I’m started using ember just before one or two weeks, so I’m not that much familiar with it. Your answer helped me a lot, and if you could share your linkedIn profile, it will be helpful for keep in touch and will be very much helpful for me