hasMany (name) HasManyReference
Defined in addon/-private/system/model/model.js:883 Available since 2.5.0
Get the reference for the specified hasMany relationship. Example // models/blog.js
export default DS.Model.extend({
comments: DS.hasMany({ async: true })
});
var blog = store.push({
type: 'blog',
id: 1,
relationships: {
comments: {
data: [
{ type: 'comment', id: 1 },
{ type: 'comment', id: 2 }
]
}
}
});
var commentsRef = blog.hasMany('comm