Merge pull request #7605 from mfo/US/cleanup_support_assign_tos

feat(clean.super_admin.assign_tos): remove former assign to so our support team is happy :-)
This commit is contained in:
mfo 2022-08-23 14:55:55 +02:00 committed by GitHub
commit ee499da8e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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