fix update_all query
This commit is contained in:
parent
a5d217aec2
commit
58a90eb4a6
1 changed files with 1 additions and 1 deletions
|
@ -8,7 +8,7 @@ namespace :after_party do
|
||||||
dossiers = Dossier.state_en_construction.where.not(en_construction_conservation_extension: 0.days)
|
dossiers = Dossier.state_en_construction.where.not(en_construction_conservation_extension: 0.days)
|
||||||
progress = ProgressReport.new((dossiers.count.to_f / BATCH_SIZE).round)
|
progress = ProgressReport.new((dossiers.count.to_f / BATCH_SIZE).round)
|
||||||
dossiers.in_batches(of: BATCH_SIZE) do |relation|
|
dossiers.in_batches(of: BATCH_SIZE) do |relation|
|
||||||
relation.update_all("dossiers.conservation_extension = dossiers.en_construction_conservation_extension")
|
relation.update_all("conservation_extension = en_construction_conservation_extension")
|
||||||
progress.inc
|
progress.inc
|
||||||
end
|
end
|
||||||
progress.finish
|
progress.finish
|
||||||
|
|
Loading…
Reference in a new issue