20240320115157_geo_location_backend_osm.rb 769 B

12345678910111213141516
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class GeoLocationBackendOsm < ActiveRecord::Migration[7.0]
  3. def change
  4. # return if it's a new setup
  5. return if !Setting.exists?(name: 'system_init_done')
  6. Setting.find_by(name: 'geo_location_backend')&.tap do |setting|
  7. setting.state_current = { 'value' => 'Service::GeoLocation::Osm' } if setting.state_current['value'] == 'Service::GeoLocation::Gmaps'
  8. setting.state_initial = { 'value' => 'Service::GeoLocation::Osm' }
  9. setting.options['form'][0]['options'].delete('Service::GeoLocation::Gmaps')
  10. setting.options['form'][0]['options']['Service::GeoLocation::Osm'] = 'OpenStreetMap (ODbL 1.0, http://osm.org/copyright)'
  11. setting.save!
  12. end
  13. end
  14. end