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).
This commit is contained in:
Maikel Linke
2015-02-26 16:25:18 +11:00
parent 379b702b9b
commit ff4bd449a2

View File

@@ -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.