我已经升级到 Ember-Data rev 12,但不知道如何加载我的 Fixture。我尝试key' and
在模型上使用 sideLoadAs`,但没有效果。
模型:
Sks.User = DS.Model.extend
kudosReceived: DS.hasMany('Sks.KudoReceived', key: 'kudo_received_ids', sideLoadAs: 'kudos_received')
name: DS.attr("string")
email: DS.attr("string")
夹具:
Sks.User.FIXTURES = [
id: 1
name: 'Joe Doe'
email: 'joe.doe@gmail.com'
kudo_received_ids: [1, 2]
kudos_received: [
id: 1
value: 2
comment: 'Because you are nice to me!'
,
id: 2
value: 3
comment: 'It was awesome!'
]
]