mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-22 05:18:51 +00:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user