I want to update a field 'owner' of a Model. The owner needs to be fetched from the session which contains the user who is currently logged in and is creating the Model.
I want something like this:
Model = {
attributes: {
},
beforeCreate(values,next)
{
var owner_user_id = req.session.user_id;
values.owner = owner_user_id;
next();
}
}