[Fix #1096] task to create new Administrations

This commit is contained in:
Mathieu Magnin 2017-12-20 17:00:17 +01:00
parent 5c9d82d46f
commit 39dc5718c2

12
lib/tasks/admin.rake Normal file
View 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