queerviolet / bones

MIT License
36 stars 119 forks source link

Updating Password in Database #49

Closed ekatzenstein closed 6 years ago

glebec commented 7 years ago

Is this actually necessary? I thought the fact that this function is being used in pre-hooks would mean it gets saved right afterwards anyway. What does this PR do that isn't already being done?

ekatzenstein commented 7 years ago

If I try to update a password, it will not update unless the save method is called. Please confirm if you're able to replicate.

glebec commented 7 years ago

I'll test it later. I believe you, I just want to understand Sequelize's hook behavior better, haha. I've found it can be annoyingly hard to make sure all the edge cases are covered. There's a beforeSave option which may or may not already be deployed (I think it was supposed to come out in V4)… I'll look into it at some point. Or @queerviolet / @khumphrey are welcome to, they've worked on this particular section of code the most I think.

ekatzenstein commented 7 years ago

Thanks Gabriel, please take your belief in this PR with a grain of salt, as something may be awry with my repo. I just found that the save method causes a console error when seeding the database (creating new entries instead of updating), but the seeding still works. There's likely an alternative that works with both.