From d93a8b642870d0ba2273a0fe93fc226fcac893e7 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 22 Jan 2015 16:22:34 +1100 Subject: [PATCH] Enterprise and Group controllers use default country instead of default country id --- app/controllers/admin/enterprise_groups_controller.rb | 2 +- app/controllers/admin/enterprises_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/enterprise_groups_controller.rb b/app/controllers/admin/enterprise_groups_controller.rb index 7a0763f5a4..89d72262d5 100644 --- a/app/controllers/admin/enterprise_groups_controller.rb +++ b/app/controllers/admin/enterprise_groups_controller.rb @@ -22,7 +22,7 @@ module Admin def build_resource_with_address enterprise_group = build_resource_without_address enterprise_group.address = Spree::Address.new - enterprise_group.address.country = Spree::Country.find_by_id(Spree::Config[:default_country_id]) + enterprise_group.address.country = Spree::Country.find_by_name(ENV['DEFAULT_COUNTRY']) enterprise_group end alias_method_chain :build_resource, :address diff --git a/app/controllers/admin/enterprises_controller.rb b/app/controllers/admin/enterprises_controller.rb index 0ee0541145..150c609d51 100644 --- a/app/controllers/admin/enterprises_controller.rb +++ b/app/controllers/admin/enterprises_controller.rb @@ -59,7 +59,7 @@ module Admin def build_resource_with_address enterprise = build_resource_without_address enterprise.address = Spree::Address.new - enterprise.address.country = Spree::Country.find_by_id(Spree::Config[:default_country_id]) + enterprise.address.country = Spree::Country.find_by_name(ENV['DEFAULT_COUNTRY']) enterprise end alias_method_chain :build_resource, :address