Bug or feature request
Issue Description
I've I've recently migrated to Loopback 3. I'm Postgresql database. One of my tests is failing with a strange behaviour. I've raised this issue on Stackoverflow as well.
I have a Member model that extends the User model. Whenever I change any property on my Member model, the emailVerified changes from true to false
Member.findById(memberId, function (err, user) {
console.log(user.emailVerified); // true
user.updateAttribute('username', 'abc', function (err, result) {
console.log(result.emailVerified); // false
})
});
I've also tried with updateAttributes but the results are the same.
I found that in user model code, emailChanged is returning true because ctx.data.email is undefined. Changing it to first check if it exists does solve my problem.
var emailChanged = ctx.hookState.originalUserData.some(function(data) {
return ctx.data.email && data.email != ctx.data.email;
});
Additional information
Node v 7,
LoopBack v 3.0
Bug or feature request
Issue Description
I've I've recently migrated to Loopback 3. I'm Postgresql database. One of my tests is failing with a strange behaviour. I've raised this issue on Stackoverflow as well.
I have a Member model that extends the User model. Whenever I change any property on my Member model, the emailVerified changes from true to false
I've also tried with updateAttributes but the results are the same.
I found that in user model code, emailChanged is returning true because ctx.data.email is undefined. Changing it to first check if it exists does solve my problem.
Additional information
Node v 7,
LoopBack v 3.0