mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
14 lines
376 B
Ruby
14 lines
376 B
Ruby
|
|
# frozen_string_literal: true
|
||
|
|
|
||
|
|
class DataMigrations::MigratePointsLatlonJob < ApplicationJob
|
||
|
|
queue_as :default
|
||
|
|
|
||
|
|
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
|