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:
commit
ee499da8e8
1 changed files with 12 additions and 0 deletions
|
@ -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
|
Loading…
Reference in a new issue