mirror of
https://github.com/Freika/dawarich.git
synced 2025-12-19 03:30:59 -06:00
Recalculate stats after changing distance units
This commit is contained in:
15
CHANGELOG.md
15
CHANGELOG.md
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
# [0.29.2] - 2025-07-12
|
||||
|
||||
⚠️ If you were using RC, please run the following commands in the console, otherwise read on. ⚠️
|
||||
|
||||
```ruby
|
||||
# This will delete all tracks 👇
|
||||
Track.delete_all
|
||||
|
||||
# This will remove all tracks relations from points 👇
|
||||
Point.update_all(track_id: nil)
|
||||
|
||||
# This will create tracks for all users 👇
|
||||
User.find_each do |user|
|
||||
Tracks::CreateJob.perform_later(user.id, start_at: nil, end_at: nil, mode: :bulk)
|
||||
end
|
||||
```
|
||||
|
||||
## Added
|
||||
|
||||
- In the User Settings -> Background Jobs, you can now disable visits suggestions, which is enabled by default. It's a background task that runs every day around midnight. Disabling it might be useful if you don't want to receive visits suggestions or if you're using the Dawarich iOS app, which has its own visits suggestions.
|
||||
|
||||
@@ -4,7 +4,7 @@ class BulkStatsCalculatingJob < ApplicationJob
|
||||
queue_as :stats
|
||||
|
||||
def perform
|
||||
user_ids = User.pluck(:id)
|
||||
user_ids = User.active.pluck(:id)
|
||||
|
||||
user_ids.each do |user_id|
|
||||
Stats::BulkCalculator.new(user_id).call
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RecalculateStatsAfterChangingDistanceUnits < ActiveRecord::Migration[8.0]
|
||||
def up
|
||||
BulkStatsCalculatingJob.perform_later
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
||||
@@ -1 +1 @@
|
||||
DataMigrate::Data.define(version: 20250709195003)
|
||||
DataMigrate::Data.define(version: 20250720171241)
|
||||
|
||||
Reference in New Issue
Block a user