dawarich/app/jobs/data_migrations/set_points_country_ids_job.rb

12 lines
270 B
Ruby
Raw Normal View History

2025-05-16 13:53:42 -04:00
# frozen_string_literal: true
2025-05-16 12:51:48 -04:00
class DataMigrations::SetPointsCountryIdsJob < ApplicationJob
queue_as :default
def perform(point_id)
point = Point.find(point_id)
point.country_id = Country.containing_point(point.lon, point.lat).id
point.save!
end
end