[Fix #1096] task to create new Administrations
This commit is contained in:
parent
5c9d82d46f
commit
39dc5718c2
1 changed files with 12 additions and 0 deletions
12
lib/tasks/admin.rake
Normal file
12
lib/tasks/admin.rake
Normal file
|
@ -0,0 +1,12 @@
|
|||
namespace :admin do
|
||||
task :create_admin, [:email] => :environment do |t, args|
|
||||
email = args[:email]
|
||||
puts "Creating Administration for #{email}"
|
||||
a = Administration.new(email: email, password: Devise.friendly_token[0,20])
|
||||
if a.save
|
||||
puts "#{a.email} created"
|
||||
else
|
||||
puts "An error occured : #{a.errors.full_messages}"
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue