mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
13 lines
384 B
Ruby
13 lines
384 B
Ruby
# frozen_string_literal: true
|
|
|
|
class DataMigrations::MigratePointsLatlonJob < ApplicationJob
|
|
queue_as :data_migrations
|
|
|
|
def perform(user_id)
|
|
user = User.find(user_id)
|
|
|
|
# rubocop:disable Rails/SkipsModelValidations
|
|
user.tracked_points.update_all('lonlat = ST_SetSRID(ST_MakePoint(longitude, latitude), 4326)')
|
|
# rubocop:enable Rails/SkipsModelValidations
|
|
end
|
|
end
|