fix(champs): run mentainance task on all records

This commit is contained in:
Paul Chavard 2024-03-19 14:25:36 +01:00
parent ebe762ee5d
commit 8479300328

View file

@ -3,11 +3,13 @@
module Maintenance
class FillChampsStableIdTask < MaintenanceTasks::Task
def collection
Champ.where(stable_id: nil).includes(:type_de_champ)
Champ.all
end
def process(champ)
champ.update_columns(stable_id: champ.stable_id, stream: 'main')
if !champ.attribute_present?(:stable_id)
champ.update_columns(stable_id: champ.stable_id, stream: 'main')
end
end
def count