From ff4bd449a23af142fd54ad4092a69548f103df03 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 26 Feb 2015 16:25:18 +1100 Subject: [PATCH] Setting default_country_id by application.yml The spree default_country_id was set using ENV["DEFAULT_COUNTRY"] for production environment, but not for tests and development. Since tests reset the default_country_id in specs/support/seeds.rb, only the development environment had a fix id set to 12. This is removed now. This fixes creating enterprises and enterprise groups without sample data (12 is Australia). --- config/initializers/spree.rb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/config/initializers/spree.rb b/config/initializers/spree.rb index dca89955b7..5912e0b9ec 100644 --- a/config/initializers/spree.rb +++ b/config/initializers/spree.rb @@ -14,13 +14,8 @@ Spree.config do |config| config.checkout_zone = ENV["CHECKOUT_ZONE"] config.address_requires_state = true - # 12 should be Australia. Hardcoded for CI (Jenkins), where countries are not pre-loaded. - if Rails.env.test? or Rails.env.development? - config.default_country_id = 12 - else - country = Spree::Country.find_by_name(ENV["DEFAULT_COUNTRY"]) - config.default_country_id = country.id if country.present? - end + country = Spree::Country.find_by_name(ENV["DEFAULT_COUNTRY"]) + config.default_country_id = country.id if country.present? # -- spree_paypal_express # Auto-capture payments. Without this option, payments must be manually captured in the paypal interface.