Created
February 2, 2018 10:51
-
-
Save b-ggs/50749921aef141a7b261db3d2311a4b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
names = [ | |
"Pam Halpert-Beesly", | |
"Jim Halpert", | |
"Erin Hannon", | |
"Ryan Howard", | |
"Kelly Kapoor", | |
"Angela Martin", | |
"Oscar Martinez", | |
"Michael Scott", | |
"Dwight Schrute", | |
"Kevin Malone", | |
"Merideth Palmer", | |
] | |
names.each do |name| | |
email = "#{name.downcase.split(' ').join('.')}@indinero.com" | |
fullservice = User.find_or_initialize_by_email(email) | |
fullservice.name = name | |
fullservice.first_name = name.split(' ')[0] | |
fullservice.last_name = name.split(' ')[1] | |
fullservice.role = User::Roles::BOOKKEEPER | |
salt = User.generate_salt | |
fullservice.salt = salt | |
fullservice.password = BCrypt::Password.create(User.encrypt('password', salt)) | |
fullservice.password_confirmation = User.encrypt('password', salt) | |
fullservice.save | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment