Ember.js 不同关系的同一模型

Ember.js 不同关系的同一模型,ember.js,ember-data,Ember.js,Ember Data,我想将我的文件模型与其他两个模型一起使用 App.File = DS.Model.extend({ filename: DS.attr('string'), //related:DS.belongsTo('App.Task' and 'App.Comment'), }); App.Task = DS.Model.extend({ title: DS.attr('string'), files:DS.hasMany('App.Files'), }); App.Com

我想将我的文件模型与其他两个模型一起使用

App.File = DS.Model.extend({
   filename: DS.attr('string'),
   //related:DS.belongsTo('App.Task' and 'App.Comment'),
});

App.Task = DS.Model.extend({
    title: DS.attr('string'),
    files:DS.hasMany('App.Files'),
});

App.Comment = DS.Model.extend({
    comment:DS.attr('string'),
    files:DS.hasMany('App.Files'),
});

数据库结构具有相关的\u id和相关的\u类型列。如何将此设置为与ember一起使用?

除非我缺少某些内容,否则您必须在您的
文件中添加
任务
注释
属性作为
以下属性