Sha256: 059f4c1e6ed04de3e7e4434d34876f80bf33d84ec997be6c135dea825716ebf3

Contents?: true

Size: 709 Bytes

Versions: 53

Compression:

Stored size: 709 Bytes

Contents

require 'highline/import'

namespace :push_type do
  desc 'Create confirmed and authenticated user account'
  task create_user: :environment do
    say 'Creating user. Please answer questions...'

    user = PushType::User.new({
      name:         ask("Full name:\t"),
      email:        ask("Email address:\t"),
      password:     ask("Password:\t") { |q| q.echo = '*' },

      confirmation_sent_at: Time.zone.now,
      confirmed_at:         Time.zone.now,
      confirmation_token:   'Generated account'
    })

    if user.save
      say 'User successfully created'
    else
      say 'Error:'
      user.errors.full_messages.each { |e| say "\t#{e}" }
      say 'Please try again...'
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
push_type_auth-0.12.1 lib/tasks/push_type_tasks.rake
push_type_auth-0.12.0 lib/tasks/push_type_tasks.rake
push_type_auth-0.12.0.beta.1 lib/tasks/push_type_tasks.rake
push_type_auth-0.11.2 lib/tasks/push_type_tasks.rake
push_type_auth-0.11.1 lib/tasks/push_type_tasks.rake
push_type_auth-0.11.0.beta.2 lib/tasks/push_type_tasks.rake
push_type_auth-0.11.0.beta.1 lib/tasks/push_type_tasks.rake
push_type_auth-0.10.4 lib/tasks/push_type_tasks.rake
push_type_auth-0.10.3 lib/tasks/push_type_tasks.rake
push_type_auth-0.10.2 lib/tasks/push_type_tasks.rake
push_type_auth-0.10.1 lib/tasks/push_type_tasks.rake
push_type_auth-0.10.0 lib/tasks/push_type_tasks.rake
push_type_auth-0.10.0.beta.5 lib/tasks/push_type_tasks.rake
push_type_auth-0.10.0.beta.3 lib/tasks/push_type_tasks.rake
push_type_auth-0.9.5 lib/tasks/push_type_tasks.rake
push_type_auth-0.9.3 lib/tasks/push_type_tasks.rake
push_type_auth-0.9.2 lib/tasks/push_type_tasks.rake
push_type_auth-0.9.1 lib/tasks/push_type_tasks.rake
push_type_auth-0.9.0 lib/tasks/push_type_tasks.rake
push_type_auth-0.9.0.beta.4 lib/tasks/push_type_tasks.rake