fix(champs): run mentainance task on all records
This commit is contained in:
parent
ebe762ee5d
commit
8479300328
1 changed files with 4 additions and 2 deletions
|
@ -3,11 +3,13 @@
|
||||||
module Maintenance
|
module Maintenance
|
||||||
class FillChampsStableIdTask < MaintenanceTasks::Task
|
class FillChampsStableIdTask < MaintenanceTasks::Task
|
||||||
def collection
|
def collection
|
||||||
Champ.where(stable_id: nil).includes(:type_de_champ)
|
Champ.all
|
||||||
end
|
end
|
||||||
|
|
||||||
def process(champ)
|
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
|
end
|
||||||
|
|
||||||
def count
|
def count
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue