mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +00:00
Rename zone.country_list to zone.countries
This commit is contained in:
@@ -11,7 +11,7 @@ module Spree
|
||||
checkout_zone = Zone.find_by(name: Spree::Config[:checkout_zone])
|
||||
|
||||
countries = if checkout_zone && checkout_zone.kind == 'country'
|
||||
checkout_zone.country_list
|
||||
checkout_zone.countries
|
||||
else
|
||||
Country.includes(:states).all
|
||||
end
|
||||
|
||||
@@ -55,7 +55,7 @@ module Spree
|
||||
end
|
||||
|
||||
# convenience method for returning the countries contained within a zone
|
||||
def country_list
|
||||
def countries
|
||||
@countries ||= case kind
|
||||
when 'country' then zoneables
|
||||
when 'state' then zoneables.collect(&:country)
|
||||
|
||||
@@ -63,7 +63,7 @@ describe Spree::Zone do
|
||||
end
|
||||
end
|
||||
|
||||
context "#country_list" do
|
||||
context "#countries" do
|
||||
let(:state) { create(:state) }
|
||||
let(:country) { state.country }
|
||||
|
||||
@@ -73,7 +73,7 @@ describe Spree::Zone do
|
||||
before { country_zone.members.create(zoneable: country) }
|
||||
|
||||
it 'should return a list of countries' do
|
||||
expect(country_zone.country_list).to eq [country]
|
||||
expect(country_zone.countries).to eq [country]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -83,7 +83,7 @@ describe Spree::Zone do
|
||||
before { state_zone.members.create(zoneable: state) }
|
||||
|
||||
it 'should return a list of countries' do
|
||||
expect(state_zone.country_list).to eq [state.country]
|
||||
expect(state_zone.countries).to eq [state.country]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user