Merge pull request #10152 from tchak/fix-champs-stable-id-task

fix(champs): run mentainance task on all records
This commit is contained in:
Paul Chavard 2024-03-19 14:12:04 +00:00 committed by GitHub
commit 776f81eb0e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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