Class: Cambium::UserGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/cambium/user_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_userObject

Create a user with the provided credentials



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/generators/cambium/user_generator.rb', line 22

def create_user
  if options.admin == true
    User.create!(
      :email => email,
      :password => password,
      :password_confirmation => password,
      :is_admin => options.admin
    )
  else
    User.create!(
      :email => email,
      :password => password,
      :password_confirmation => password
    )
  end
end