Blog platform
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

20 lines
408 B

puts "==== Pressr Admin Creation Script ===="
print "Username: "
uname = gets.chomp
print "Password: "
upass = gets.chomp
print "Email: "
uemail = gets.chomp
print "Display name: "
udname = gets.chomp
u = User.new(username: uname, display_name: udname, password: upass, email: uemail, role: 1)
if u.save
puts("Success!")
else
puts("Error(s):")
u.errors.full_messages.each do |x|
puts x
end
end