mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
Use COUNTRY_CODE instead of COUNTRY in application.yml.
This commit is contained in:
@@ -6,7 +6,7 @@ SECRET_TOKEN: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
|
||||
TIMEZONE: Melbourne
|
||||
# Default country for dropdowns etc.
|
||||
DEFAULT_COUNTRY: Australia
|
||||
DEFAULT_COUNTRY_CODE: AU
|
||||
# Locale for translation.
|
||||
LOCALE: en
|
||||
# Spree zone.
|
||||
|
||||
@@ -17,7 +17,7 @@ Spree.config do |config|
|
||||
config.checkout_zone = ENV["CHECKOUT_ZONE"]
|
||||
config.currency = ENV['CURRENCY']
|
||||
if Spree::Country.table_exists?
|
||||
country = Spree::Country.find_by_name(ENV["DEFAULT_COUNTRY"])
|
||||
country = Spree::Country.find_by_iso(ENV['DEFAULT_COUNTRY_CODE'])
|
||||
config.default_country_id = country.id if country.present?
|
||||
else
|
||||
config.default_country_id = 12 # Australia
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class AddAddressInstancesToExistingEnterpriseGroups < ActiveRecord::Migration
|
||||
def change
|
||||
country = Spree::Country.find_by_name(ENV['DEFAULT_COUNTRY'])
|
||||
country = Spree::Country.find_by_iso(ENV['DEFAULT_COUNTRY_CODE'])
|
||||
state = country.states.first
|
||||
EnterpriseGroup.all.each do |g|
|
||||
next if g.address.present?
|
||||
|
||||
Reference in New Issue
Block a user