fix(afterparty): use actual procedure ids and not gate ids

This commit is contained in:
Colin Darie 2024-09-10 18:10:17 +02:00
parent b987688d19
commit 615b4a6bc4
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4

View file

@ -14,30 +14,28 @@ namespace :after_party do
total_gates = gates.count
progress = ProgressReport.new(total_gates)
puts 'Collecte des démarches avec le feature flag'
rake_puts 'Collecte des démarches avec le feature flag'
procedure_ids = gates.ids
puts procedure_ids
procedure_ids = gates.pluck(:value).map { _1.split(";").last.to_i }
rake_puts procedure_ids.inspect
progress.finish
puts progress
puts "Mise à jour des #{procedure_ids.size} démarches"
update_progress = ProgressReport.new(procedure_ids.size)
Procedure.where(id: procedure_ids).in_batches(of: 500) do |batch|
# rubocop:disable DS/Unscoped
Procedure.unscoped.where(id: procedure_ids).in_batches(of: 500) do |batch|
batch.update_all(hide_instructeurs_email: true)
update_progress.inc(batch.size)
puts update_progress
end
# rubocop:enable DS/Unscoped
update_progress.finish
puts update_progress
puts "Suppression du feature flag '#{feature_name}'"
rake_puts "Suppression du feature flag '#{feature_name}'"
Flipper.remove(feature_name)
puts "Feature flag '#{feature_name}' supprimé avec succès"
rake_puts "Feature flag '#{feature_name}' supprimé avec succès"
AfterParty::TaskRecord
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp