From ff7390e33e087f8154e720ca25384c5d23c31dde Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Mon, 22 Nov 2021 14:54:18 -0500 Subject: [PATCH] Allow lowercase state/province abbreviations Seems like it won't overlap with other things we allow. --- lib/tel_selections.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tel_selections.rb b/lib/tel_selections.rb index 68b62d1..8da82d1 100644 --- a/lib/tel_selections.rb +++ b/lib/tel_selections.rb @@ -187,7 +187,7 @@ class TelSelections end class CityState - Q.register(/\A([^,]+)\s*,\s*([A-Z]{2})\Z/, &method(:new)) + Q.register(/\A([^,]+)\s*,\s*([a-zA-Z]{2})\Z/, &method(:new)) CITY_MAP = { "ajax" => "Ajax-Pickering", @@ -208,7 +208,7 @@ class TelSelections def initialize(city, state) @city = CITY_MAP.fetch(city.downcase, city) - @state = STATE_MAP.fetch(state, state) + @state = STATE_MAP.fetch(state.upcase, state.upcase) end def iris_query -- 2.34.2