@jfschaff wrote:
Hi, I have a model:
// app/models/expert.js export default DS.Model.extend({ ... user: DS.belongsTo('user'); ... });
and an API that gives JSON data of the form:
# /experts/07ecb03699efe504 { "id": "07ecb03699efe504", ... "user": 54, ... }
user
is another model that works well and correspond to API endpoints/users/
and/users/<id>/
. So the relationship is just given by the id of the model. This is what I do for all my models and works well in general.But with this particular model (
expert
), theuser
object is not loaded when used (for instance in a template) and allexpert.user
,expert.get('user')
andexpert.get('user.id')
areundefined
(assumingexpert
is an instance of theexpert
model)… I get no error in the console so everything looks fine, but the data is not loaded and no request goes out to the/users/54
endpoint…When I inspect the relationship with ember inspector, I have something like
user: <(unknown):ember420>
and if I send it to the console I get:Seems like a bug to me, but not sure…
How could I investigate it further?
Posts: 1
Participants: 1