Merge pull request #8601 from colinux/fix_geo_areas_without_geometry

fix(geo_area): geo_area.geometry must be valid JSON, not nil
This commit is contained in:
Colin Darie 2023-02-08 18:21:07 +01:00 committed by GitHub
commit 46a6e3054b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,18 @@
namespace :after_party do
desc 'Deployment task: fix_geo_area_without_geometry'
task fix_geo_area_without_geometry: :environment do
puts "Running deploy task 'fix_geo_area_without_geometry'"
geo_areas = GeoArea.where(geometry: nil)
geo_areas.find_each do |geo_area|
geo_area.geometry = {}
geo_area.save!
end
# Update task as completed. If you remove the line below, the task will
# run with every deploy (or every time you call after_party:run).
AfterParty::TaskRecord
.create version: AfterParty::TaskRecorder.new(__FILE__).timestamp
end
end