From b027c1a5e068986f1e2a59391a857cb5836e0c5c Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Mon, 10 Jun 2024 22:47:45 +0200 Subject: [PATCH] Run stats job after removing points without coordinates --- CHANGELOG.md | 4 ++++ db/data/20240610170930_remove_points_without_coordinates.rb | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63fefd51..d203d4fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.5.3] — 2024-06-10 +### Added + +- A data migration to remove points with 0.0, 0.0 coordinates. This is necessary to prevent errors when calculating distance in Stats page. + ### Fixed - Reworked code responsible for importing "Records.json" file from Google Takeout. Now it is more reliable and faster, and should not throw as many errors as before. diff --git a/db/data/20240610170930_remove_points_without_coordinates.rb b/db/data/20240610170930_remove_points_without_coordinates.rb index 2052f72e..b38e72ff 100644 --- a/db/data/20240610170930_remove_points_without_coordinates.rb +++ b/db/data/20240610170930_remove_points_without_coordinates.rb @@ -11,6 +11,8 @@ class RemovePointsWithoutCoordinates < ActiveRecord::Migration[7.1] .each(&:destroy) Rails.logger.info 'Points without coordinates removed.' + + StatCreatingJob.perform_later(User.pluck(:id)) end def down