diff --git a/app/admin/ascor/countries.rb b/app/admin/ascor/countries.rb index 542b19526..716030736 100644 --- a/app/admin/ascor/countries.rb +++ b/app/admin/ascor/countries.rb @@ -44,7 +44,7 @@ f.inputs do f.input :name f.input :iso, label: 'Country ISO code' - f.input :region, as: :select, collection: ASCOR::Country::REGIONS + f.input :region f.input :wb_lending_group, as: :select, collection: ASCOR::Country::LENDING_GROUPS, label: 'World Bank lending group' f.input :fiscal_monitor_category, as: :select, collection: ASCOR::Country::MONITOR_CATEGORIES, label: 'International Monetary Fund fiscal monitor category' diff --git a/app/models/ascor/country.rb b/app/models/ascor/country.rb index d0d169f92..c10c17aa1 100644 --- a/app/models/ascor/country.rb +++ b/app/models/ascor/country.rb @@ -18,14 +18,6 @@ class ASCOR::Country < ApplicationRecord include VisibilityStatus extend FriendlyId - REGIONS = [ - 'Africa', - 'Asia', - 'Europe', - 'Latin America and Caribbean', - 'North America', - 'Oceania' - ].freeze LENDING_GROUPS = %w[High-income Upper-middle-income Lower-middle-income Low-income].freeze MONITOR_CATEGORIES = [ 'Advanced economies', @@ -49,7 +41,6 @@ class ASCOR::Country < ApplicationRecord validates_presence_of :name, :slug, :iso, :region, :wb_lending_group, :fiscal_monitor_category validates_uniqueness_of :name, :slug, :iso - validates :region, inclusion: {in: REGIONS}, allow_nil: true validates :wb_lending_group, inclusion: {in: LENDING_GROUPS}, allow_nil: true validates :fiscal_monitor_category, inclusion: {in: MONITOR_CATEGORIES}, allow_nil: true validates :type_of_party, inclusion: {in: TYPE_OF_PARTY}, allow_nil: true diff --git a/spec/models/ascor/countries_spec.rb b/spec/models/ascor/countries_spec.rb index 74ef9f1fb..aaf1391d8 100644 --- a/spec/models/ascor/countries_spec.rb +++ b/spec/models/ascor/countries_spec.rb @@ -42,11 +42,6 @@ expect(subject).to have(1).errors_on(:iso) end - it 'should be invalid if region is not in REGIONS' do - subject.region = 'TEST' - expect(subject).to have(1).errors_on(:region) - end - it 'should be invalid if wb_lending_group is not in LENDING_GROUPS' do subject.wb_lending_group = 'TEST' expect(subject).to have(1).errors_on(:wb_lending_group)