From 55b184555bbb62eaaf5bcf09940c830251187fe8 Mon Sep 17 00:00:00 2001 From: Holden Mitchell Date: Fri, 23 Jan 2026 12:14:57 -0600 Subject: [PATCH] Fix progress bar --- lib/tasks/ocdc.rake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/tasks/ocdc.rake b/lib/tasks/ocdc.rake index db1bce6b..7f415283 100644 --- a/lib/tasks/ocdc.rake +++ b/lib/tasks/ocdc.rake @@ -25,11 +25,11 @@ namespace :ocdc do puts "Geocoding #{total} arrests..." return if total.zero? - progressbar = ProgressBar.create(total: total, format: '%a %B %p%% %c/%C') + bar = ProgressBar.new(total) arrests.find_each do |arrest_info| Importers::Ocdc::ArrestGeocoder.new(arrest_info).geocode - progressbar.increment + bar.increment! end puts "Done! #{Ocdc::ArrestGeocode.count} total geocodes in database." @@ -44,11 +44,11 @@ namespace :ocdc do puts "Geocoding #{total} pre-2023 arrests..." return if total.zero? - progressbar = ProgressBar.create(total: total, format: '%a %B %p%% %c/%C') + bar = ProgressBar.new(total) arrests.each do |arrest_info| Importers::Ocdc::ArrestGeocoder.new(arrest_info).geocode - progressbar.increment + bar.increment! end puts "Done! #{Ocdc::ArrestGeocode.count} total geocodes in database."