Genshin/GAKUEngine

View on GitHub
core/db/default/gaku/states.rb

Summary

Maintainability
A
0 mins
Test Coverage
Gaku::Country.where(states_required: true).each do |country|
  carmen_country = Carmen::Country.named(country.name)

  carmen_country.subregions.each do |subregion|
    unless Gaku::State.exists?(name: subregion.name, country_iso: country.iso)
      Gaku::State.create!(name: subregion.name, abbr: subregion.code, country_iso: country.iso)
    end
  end
end