feat(clean.super_admin.assign_tos): remove former assign to so our support team is happy :-)
This commit is contained in:
parent
ee0280de17
commit
e23525ff4a
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