I want to insert new data in Event model when the property "code" in Transaction model is equal to 3
module.exports = function(Transaction) {
Transaction.observe('before save', function(ctx, next) {
if(ctx.data.code == 3){
//How to access and insert data in Event model ?
}
});
};