Creating user accounts and changing password from the console - uclibs/ucrate GitHub Wiki

The following is a procedure for creating user accounts from the console.

  1. bundle exec rails console or bundle exec rails console production

  2. Adjust the variables below and paste them into the console:

     email = '[email protected]'
     password = 'pass1234'
     first_name = 'John'
     last_name = 'Doe'
    
  3. Copy and paste the code block below into the console:

     user = User.create email: email, first_name: first_name, last_name: last_name, password: password, password_confirmation: password
     user.save
    

exit

Test the new user's login and then put the credentials in a https://privnote.com and email them the link.

user = User.find_by(email: '[email protected]') user.password = 'new_secure_password' user.password_confirmation = 'new_secure_password' user.save!