create a superadmin account
rake task create a superadmin account, and send reset password instructions
This commit is contained in:
parent
305ccdc0cd
commit
3fdb045356
1 changed files with 3 additions and 1 deletions
|
@ -18,10 +18,12 @@ namespace :superadmin do
|
||||||
email = args[:email]
|
email = args[:email]
|
||||||
|
|
||||||
rake_puts "Creating Administration for #{email}"
|
rake_puts "Creating Administration for #{email}"
|
||||||
a = Administration.new(email: email, password: Devise.friendly_token[0, 20])
|
a = Administration.new(email: email, password: Devise.friendly_token)
|
||||||
|
|
||||||
if a.save
|
if a.save
|
||||||
rake_puts "#{a.email} created"
|
rake_puts "#{a.email} created"
|
||||||
|
a.send_reset_password_instructions
|
||||||
|
rake_puts "Password reset instructions sent to #{a.email}"
|
||||||
else
|
else
|
||||||
rake_puts "An error occured: #{a.errors.full_messages}"
|
rake_puts "An error occured: #{a.errors.full_messages}"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue