mardi 8 mars 2016

Ember-data 2: How to retrieve belongsTo model id without store fetching record

I have an activity model that belongs to a report. I have a scenario where I have only the activity records and all I want to do is get the report id, without fetching the whole record.

activity.get('report_id') // undefined

activity.get('report.id') // the id! But after a full fetch

Obviously, it knows the id, but I can't figure out the right incantation. Anyone have any thoughts?

ps. It looks like this changed in ember-data 2 so a previous answer will not work.

-------------------------------
Ember             : 2.4.1
Ember Data        : 2.4.0+9f8c40927a
jQuery            : 1.11.3
Ember Simple Auth : 1.0.0
-------------------------------




Aucun commentaire:

Enregistrer un commentaire