Sha256: 8c3c485e94c34b0296cc910675ae7cceaec8101813ce9582c07be89bcf2ec8ca

Contents?: true

Size: 355 Bytes

Versions: 32

Compression:

Stored size: 355 Bytes

Contents

require 'carmen'

ActiveRecord::Base.transaction do
  Carmen::Country.all.each do |country|
    Spree::Country.where(iso: country.alpha_2_code).first_or_create!(
      name: country.name,
      iso3: country.alpha_3_code,
      iso_name: country.name.upcase,
      numcode: country.numeric_code,
      states_required: country.subregions?
    )
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
solidus_core-2.3.1 db/default/spree/countries.rb
solidus_core-2.2.2 db/default/spree/countries.rb
solidus_core-2.1.1 db/default/spree/countries.rb
solidus_core-2.0.3 db/default/spree/countries.rb
solidus_core-1.4.2 db/default/spree/countries.rb
solidus_core-1.3.2 db/default/spree/countries.rb
solidus_core-2.3.0 db/default/spree/countries.rb
solidus_core-2.3.0.rc3 db/default/spree/countries.rb
solidus_core-2.3.0.rc2 db/default/spree/countries.rb
solidus_core-2.3.0.rc1 db/default/spree/countries.rb
solidus_core-2.3.0.beta1 db/default/spree/countries.rb
solidus_core-2.0.2 db/default/spree/countries.rb
solidus_core-1.4.1 db/default/spree/countries.rb
solidus_core-2.2.1 db/default/spree/countries.rb
solidus_core-2.2.0 db/default/spree/countries.rb
solidus_core-2.2.0.rc1 db/default/spree/countries.rb
solidus_core-2.2.0.beta1 db/default/spree/countries.rb
solidus_core-2.1.0 db/default/spree/countries.rb
solidus_core-2.1.0.rc1 db/default/spree/countries.rb
solidus_core-2.0.1 db/default/spree/countries.rb