Migrating from has_secure_password
to devise causes the following error in the console when interacting with user objects:
.rvm/gems/ruby-2.4.1/gems/devise-4.4.0/lib/devise/models/database_authenticatable.rb:166:in `password_digest'
I understand this is because devise uses the pasword_digest
function and so it is incompatible with the password_digest
column used by active record
's has_secure password
.
A solution is to delete the password_digest
column from the db but I do not want to loose existing users' passwords.
Should I delete the encrypted_password
column devise created and then do a migration to rename password_digest
to encrypted_password
and then update existing user's passwords or is there a more appropriate solution?