Sha256: 46ca8a4beb6e611df7fb30f14aa453724c4242b3f6e70a11b4efd6491333e626

Contents?: true

Size: 338 Bytes

Versions: 55

Compression:

Stored size: 338 Bytes

Contents

Spree::Country.where(states_required: true).each do |country|
  carmen_country = Carmen::Country.named(country.name)
  next unless carmen_country

  carmen_country.subregions.each do |subregion|
    country.states.where(
      name: subregion.name,
      abbr: subregion.code,
      country_id: country.id
    ).first_or_create
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
spree_core-4.0.9 db/default/spree/states.rb
spree_core-4.1.15 db/default/spree/states.rb
spree_core-4.1.14 db/default/spree/states.rb
spree_core-4.0.8 db/default/spree/states.rb
spree_core-3.7.14.1 db/default/spree/states.rb
spree_core-4.1.13.1 db/default/spree/states.rb
spree_core-4.0.7.1 db/default/spree/states.rb
spree_core-4.0.7 db/default/spree/states.rb
spree_core-3.7.14 db/default/spree/states.rb
spree_core-4.1.13 db/default/spree/states.rb
spree_core-4.0.6 db/default/spree/states.rb
spree_core-3.7.13 db/default/spree/states.rb
spree_core-4.0.5 db/default/spree/states.rb
spree_core-4.1.12 db/default/spree/states.rb
spree_core-3.7.12 db/default/spree/states.rb
spree_core-4.0.4 db/default/spree/states.rb
spree_core-3.7.11 db/default/spree/states.rb
spree_core-4.1.11 db/default/spree/states.rb
spree_core-4.1.10 db/default/spree/states.rb
spree_core-4.2.0.beta db/default/spree/states.rb