Class: Postnhost::Generators::UserGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Postnhost::Generators::UserGenerator
- Defined in:
- lib/generators/postnhost/user/user_generator.rb
Instance Method Summary collapse
Instance Method Details
#create_user ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/generators/postnhost/user/user_generator.rb', line 6 def create_user attributes = prompt_for_user_attributes raise Thor::Error, "Passwords do not match." unless matching_passwords?(attributes) user = Postnhost::User.new(attributes) raise Thor::Error, user.errors..to_sentence unless user.save say("Created CMS user #{user.email}.", :green) end |