I would like to make a relation between two models User and Task using backbone-relational.
I would like for each Task to get the User model or User attributes.
The relation between the two models is the following:
taskModel.creator_id = userModel.id
// TaskModel
var TaskModel = Backbone.RelationalModel.extend({
relations: [
{
type: 'HasOne',
key: 'creator_id',
relatedModel: UserModel
}
],
urlRoot: 'url_get_tasks'
});