Merge pull request #10152 from tchak/fix-champs-stable-id-task
fix(champs): run mentainance task on all records
This commit is contained in:
commit
776f81eb0e
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue