From ad164b0edd0aeb63b49fe02d07d475dbd7e3b4c2 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Tue, 25 Jun 2024 22:42:05 +0200 Subject: [PATCH] Use old calculation of city visits in right sidebar on Map page due to performance issues --- CHANGELOG.md | 1 - app/controllers/map_controller.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59f428cd..67d8215e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Changed -- Calculation of city visits that are shown in right sidebar on Map page was reworked and now is more accurate. - Order of points on Points page is now descending by timestamp instead of ascending. --- diff --git a/app/controllers/map_controller.rb b/app/controllers/map_controller.rb index dd3e710c..96376d09 100644 --- a/app/controllers/map_controller.rb +++ b/app/controllers/map_controller.rb @@ -6,7 +6,7 @@ class MapController < ApplicationController def index @points = current_user.tracked_points.without_raw_data.where('timestamp >= ? AND timestamp <= ?', start_at, end_at).order(timestamp: :asc) - @countries_and_cities = Visits::Calculate.new(@points).uniq_visits + @countries_and_cities = CountriesAndCities.new(@points).call @coordinates = @points.pluck(:latitude, :longitude, :battery, :altitude, :timestamp, :velocity, :id) .map { [_1.to_f, _2.to_f, _3.to_s, _4.to_s, _5.to_s, _6.to_s, _7] }