Class: Geri::Tasks::CreateAdminUser
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- Geri::Tasks::CreateAdminUser
- Includes:
- Thor::Actions
- Defined in:
- lib/geri/tasks/create_admin_user.rb
Instance Method Summary collapse
- #ask_admin_email ⇒ Object
- #ask_admin_first_name ⇒ Object
- #ask_admin_last_name ⇒ Object
- #ask_admin_password ⇒ Object
- #confirm_admin_password ⇒ Object
- #create_admin_user ⇒ Object
Instance Method Details
#ask_admin_email ⇒ Object
6 7 8 9 |
# File 'lib/geri/tasks/create_admin_user.rb', line 6 def ask_admin_email say('Create a new Admin User') @email = ask('Email:') end |
#ask_admin_first_name ⇒ Object
11 12 13 |
# File 'lib/geri/tasks/create_admin_user.rb', line 11 def ask_admin_first_name @first_name = ask('First Name:') end |
#ask_admin_last_name ⇒ Object
15 16 17 |
# File 'lib/geri/tasks/create_admin_user.rb', line 15 def ask_admin_last_name @last_name = ask('Last Name:') end |
#ask_admin_password ⇒ Object
19 20 21 |
# File 'lib/geri/tasks/create_admin_user.rb', line 19 def ask_admin_password @password = ask('Password:', echo: false) end |
#confirm_admin_password ⇒ Object
23 24 25 |
# File 'lib/geri/tasks/create_admin_user.rb', line 23 def confirm_admin_password @confirmation = ask("\nPassword Confirmation:", echo: false) end |
#create_admin_user ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/geri/tasks/create_admin_user.rb', line 27 def create_admin_user AdminUser.create!( validate_password: true, email: @email, password: @password, password_confirmation: @confirmation, first_name: @first_name, last_name: @last_name) say("\nCreated admin with email '#{@email}'") end |