Sha256: bc7dda5eca5617a762f2ed7652f52eca6dc8b06a655afd233d758521b09c0c06

Contents?: true

Size: 554 Bytes

Versions: 52

Compression:

Stored size: 554 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]          : ', 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
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
para-0.7.3.p5 lib/generators/para/admin_user/admin_user_generator.rb
para-0.7.3.p4 lib/generators/para/admin_user/admin_user_generator.rb
para-0.7.3.p3 lib/generators/para/admin_user/admin_user_generator.rb
para-0.7.3.p2 lib/generators/para/admin_user/admin_user_generator.rb
para-0.7.3.p1 lib/generators/para/admin_user/admin_user_generator.rb
para-0.7.3 lib/generators/para/admin_user/admin_user_generator.rb
para-0.7.2 lib/generators/para/admin_user/admin_user_generator.rb
para-0.7.1 lib/generators/para/admin_user/admin_user_generator.rb
para-0.7.0 lib/generators/para/admin_user/admin_user_generator.rb
para-0.6.9 lib/generators/para/admin_user/admin_user_generator.rb
para-0.6.8 lib/generators/para/admin_user/admin_user_generator.rb
para-0.6.7 lib/generators/para/admin_user/admin_user_generator.rb