namespace :deploy do
desc "TODO"
task init_admin: :environment do
if Admin.all.size > 0
Admin.all.each do |a|
a.destroy
end
end
puts "Admins: " + Admin.all.size.to_s
admin = Admin.create(email: "mail@admin.com", password: "password")
puts "errors: "
puts admin.errors
end
end
bundle exec rake deploy:init_admin
Admins: 0
errors: