feat(clean.super_admin.assign_tos): remove former assign to so our support team is happy :-)

This commit is contained in:
Martin 2022-07-25 09:10:41 +02:00 committed by mfo
parent ee0280de17
commit e23525ff4a

View file

@ -0,0 +1,12 @@
class CleanupAssignTosFromBetagouv < ActiveRecord::Migration[6.1]
def up
super_admin_emails = SuperAdmin.all.pluck(:email)
super_admin_emails.each do |email|
user = User.find_by(email: email)
if user && user.instructeur
user.instructeur.assign_to.destroy_all
end
end
end
end