Porting Zips Can Contain "-"

Christopher Vollick created

I use presence of only numerals to guess if a port is Canadian or not.
Today we got a Zip+4, which has a dash. Right... that...

Change summary

lib/port_in_order.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

lib/port_in_order.rb 🔗

@@ -8,7 +8,7 @@ class PortInOrder
 			"BillingTelephoneNumber", "Subscriber", "WirelessInfo"
 		)
 		# If the zip has anything that's not a digit, assume Canada
-		if params.dig("Subscriber", "ServiceAddress", "Zip") =~ /[^\d\s]/
+		if params.dig("Subscriber", "ServiceAddress", "Zip") =~ /[^-\d\s]/
 			Canada.new(customer, params)
 		else
 			new(customer, params)