mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-10 01:01:39 -05:00
Add data migration to create tracks from points
This commit is contained in:
parent
15be46b604
commit
7619feff69
5 changed files with 18 additions and 2 deletions
|
|
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
- Don't check for new version in production.
|
||||
- Area popup styles are now more consistent.
|
||||
- Notification about Photon API load is now disabled.
|
||||
|
||||
## Fixed
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class OwnTracks::Params
|
|||
attr_reader :params
|
||||
|
||||
def initialize(params)
|
||||
@params = params.to_h.deep_symbolize_keys
|
||||
@params = Oj.load(params).to_h.deep_symbolize_keys
|
||||
end
|
||||
|
||||
# rubocop:disable Metrics/MethodLength
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
class CreatePhotonLoadNotification < ActiveRecord::Migration[8.0]
|
||||
def up
|
||||
return
|
||||
|
||||
User.find_each do |user|
|
||||
Notifications::Create.new(
|
||||
user:, kind: :info, title: '⚠️ Photon API is under heavy load', content: notification_content
|
||||
|
|
|
|||
13
db/data/20250704185707_create_tracks_from_points.rb
Normal file
13
db/data/20250704185707_create_tracks_from_points.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateTracksFromPoints < ActiveRecord::Migration[8.0]
|
||||
def up
|
||||
User.find_each do |user|
|
||||
Tracks::CreateJob.perform_later(user.id)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
||||
|
|
@ -1 +1 @@
|
|||
DataMigrate::Data.define(version: 20250518174305)
|
||||
DataMigrate::Data.define(version: 20250704185707)
|
||||
|
|
|
|||
Loading…
Reference in a new issue