Rails/Devise: valid_password? method returns nil

2019-08-08 13:40发布

问题:

In my app there are two kinds of users (Athletes & Users). The Athlete model extends the User model and the regular user model assigns different roles to other kinds of users.

For some reason one some of my users with a certain kind of role, the valid_password? method is not working. This is for users who have been invited via the invitable devise module. Any one else run into this? This is causing my app to not work properly where invited users cannot log in

回答1:

This can be fixed by setting the invitation_token to nil.