Class: Para::AdminUserGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/para/admin_user/admin_user_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_admin_userObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/generators/para/admin_user/admin_user_generator.rb', line 5

def create_admin_user
  say 'Creating default admin...'

  email =    ask('Email    [[email protected]] : ').presence || '[email protected]'
  password = ask('Password [password]          : ', echo: false).presence || 'password'
  print "\n" # echo: false doesn't print a newline so we manually add it

  AdminUser.create! email: email, password: password

  say 'Created AdminUser'
end