Sha256: 03fef9debdc52f8853a9b55934384fc8843638c8dcd6963c79e25d635a06bf34

Contents?: true

Size: 464 Bytes

Versions: 7

Compression:

Stored size: 464 Bytes

Contents

module Para
  class AdminUserGenerator < Rails::Generators::Base
    source_root File.expand_path("../templates", __FILE__)

    def create_admin_user
      say 'Creating default admin...'

      email =    ask('Email    [admin@example.com] : ').presence || 'admin@example.com'
      password = ask('Password [password]          : ').presence || 'password'

      AdminUser.create! email: email, password: password

      say 'Created AdminUser'
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
para-0.6.3 lib/generators/para/admin_user/admin_user_generator.rb
para-0.6.2 lib/generators/para/admin_user/admin_user_generator.rb
para-0.5.4 lib/generators/para/admin_user/admin_user_generator.rb
para-0.5.3 lib/generators/para/admin_user/admin_user_generator.rb
para-0.5.1 lib/generators/para/admin_user/admin_user_generator.rb
para-0.5.0 lib/generators/para/admin_user/admin_user_generator.rb
para-0.4.0 lib/generators/para/admin_user/admin_user_generator.rb