Skip to content

Instantly share code, notes, and snippets.

@ElliotGage
Created September 27, 2012 17:58
Show Gist options
  • Save ElliotGage/3795407 to your computer and use it in GitHub Desktop.
Save ElliotGage/3795407 to your computer and use it in GitHub Desktop.
International Shipping
# load "#{Rails.root}/lib/create_international_zone.rb"
#Create International Zone with all Countries
zone = Spree::Zone.where(:name => 'International').first
if zone.nil?
zone = Spree::Zone.new
zone.name = 'International'
zone.description = "All Countries"
zone.default_tax = false
zone.save
end
Spree::Country.all.each do |c|
zm = Spree::ZoneMember.new
zm.zoneable_type = "Spree::Country"
zm.zone_id = zone.id
zm.zoneable_id = c.id
zm.save
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment