Ember Data では、デフォルトで選択されるものとは異なるモデルまたは外部キーを使用する属している/hasMany 関連付けをどのように定義しますか?
たとえばApp.Item
、モデルに属してApp.User
いるが、属性を介してユーザーにアクセスしたいowner
:
App.Item = DS.Model.extend({
owner: DS.belongsTo('App.User'),
});
item.get('owner'); // should be an App.User
// And the data from the server looks like:
{
owner: 2, //id
}