Merge pull request #9534 from demarches-simplifiees/unroute-cloned-procedures-from-different-admin

Correction (2e essai) : désactive le routage de procédures clonées ou l'admin n'était pas aussi admin de la procédure parente
This commit is contained in:
Colin Darie 2023-09-28 18:07:35 +00:00 committed by GitHub
commit 6ba4f901c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,9 @@ namespace :after_party do
.with_discarded
.where(routing_enabled: true)
.filter { |p| p.groupe_instructeurs.active.count == 1 }
.update_all(routing_enabled: false)
.each do |p|
p.update!(routing_enabled: false)
end
# Update task as completed. If you remove the line below, the task will
# run with every deploy (or every time you call after_party:run).