Rename zone.country_list to zone.countries

This commit is contained in:
Luis Ramos
2020-08-26 23:12:48 +01:00
parent 53de04121c
commit 5b3e350204
3 changed files with 5 additions and 5 deletions

View File

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

View File

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

View File

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