From 71557229576c0b52996a77488c996acc14c37f40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Gaya?= <sebastien.gaya@gmail.com>
Date: Mon, 18 Oct 2021 10:25:52 +0200
Subject: [PATCH] fix

---
 lib/tasks/app.rake | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/tasks/app.rake b/lib/tasks/app.rake
index c4ef400a3..ecd86d61a 100644
--- a/lib/tasks/app.rake
+++ b/lib/tasks/app.rake
@@ -8,7 +8,10 @@ namespace :app do
 
   desc 'Fix things'
   task fix: :environment do
-    User.find_each(&:confirm)
+    User.find_each { |u|
+      u.confirm
+      u.update(role: :visitor) if u.role.nil?
+    }
   end
 
   namespace :db do
-- 
GitLab