Fix typo in sample_data zone creation (zonEable) and added clause to avoid re-adding the same country to the zone

This commit is contained in:
luisramos0
2019-02-27 23:19:39 +00:00
parent ad5c379771
commit 03d242c061

View File

@@ -15,7 +15,7 @@ module Addressing
def zone
zone = Spree::Zone.find_or_create_by_name!(ENV.fetch('CHECKOUT_ZONE'))
zone.members.create!(zonable: country)
zone.members.create!(zoneable: country) unless zone.zoneables.include?(country)
zone
end