I have a Ruby on Rails application with around 300 email subscribed. For technical reasons I had to modify a good part of the database, if I save the old user email and the password_digest, can I insert in my new database the old user manteining their old password?
To store password I use the following gem:
gem 'bcrypt'
In every model I have this:
has_secure_password
In the migration:
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :email
t.string :password_digest
...
end
end
end
This allows me to save the password by simply doing
user = User.find x
user.password = "password"
user.save
The perfect solution for me would be saving my current email and password_digest so the user in the new database will have the same password. Is that possible?