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.12.4 lib/generators/para/admin_user/admin_user_generator.rb
para-0.12.3 lib/generators/para/admin_user/admin_user_generator.rb
para-0.12.2 lib/generators/para/admin_user/admin_user_generator.rb
para-0.12.1 lib/generators/para/admin_user/admin_user_generator.rb
para-0.12.0 lib/generators/para/admin_user/admin_user_generator.rb
para-0.11.4 lib/generators/para/admin_user/admin_user_generator.rb
para-0.11.3 lib/generators/para/admin_user/admin_user_generator.rb
para-0.11.2 lib/generators/para/admin_user/admin_user_generator.rb
para-0.11.1 lib/generators/para/admin_user/admin_user_generator.rb
para-0.11.0 lib/generators/para/admin_user/admin_user_generator.rb
para-0.10.0 lib/generators/para/admin_user/admin_user_generator.rb
para-0.9.4 lib/generators/para/admin_user/admin_user_generator.rb
para-0.9.3.3 lib/generators/para/admin_user/admin_user_generator.rb
para-0.9.3.2 lib/generators/para/admin_user/admin_user_generator.rb
para-0.9.3.1 lib/generators/para/admin_user/admin_user_generator.rb
para-0.9.2 lib/generators/para/admin_user/admin_user_generator.rb
para-0.9.0 lib/generators/para/admin_user/admin_user_generator.rb
para-0.8.15 lib/generators/para/admin_user/admin_user_generator.rb
para-0.8.14 lib/generators/para/admin_user/admin_user_generator.rb
para-0.8.13 lib/generators/para/admin_user/admin_user_generator.rb