Commit cd219310c031c34a30bd909ec7f8ecdcc5090960
1 parent
ed2082b0
Exists in
master
and in
1 other branch
add util task for creating users
Showing
1 changed file
with
13 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,13 @@ |
1 | +namespace :util do | |
2 | + desc "Add user to API" | |
3 | + task :useradd, [:email, :password] => [:environment] do |t, args| | |
4 | + u = User.create!( | |
5 | + :email => args[:email], | |
6 | + :password => args[:password], | |
7 | + :password_confirmation => args[:password] | |
8 | + ) | |
9 | + u.email_confirmed = true | |
10 | + u.save! | |
11 | + puts "Added user #{args[:email]} with password: #{args[:password]}" | |
12 | + end | |
13 | +end | ... | ... |