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,12 +3,14 @@
|
|||
module Maintenance
|
||||
class FillChampsStableIdTask < MaintenanceTasks::Task
|
||||
def collection
|
||||
Champ.where(stable_id: nil).includes(:type_de_champ)
|
||||
Champ.all
|
||||
end
|
||||
|
||||
def process(champ)
|
||||
if !champ.attribute_present?(:stable_id)
|
||||
champ.update_columns(stable_id: champ.stable_id, stream: 'main')
|
||||
end
|
||||
end
|
||||
|
||||
def count
|
||||
sql = "SELECT reltuples FROM pg_class WHERE relname = 'champs';"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue