fix: instead of looking for 'asian' at the start of a word, look for it

after a word boundary.  This means it still doesn't get confused with
caucasian and it's more flexible whan asian appears inside other text
such as 'Caucasian and Asian and Black'
This commit is contained in:
Nelson Jovel 2023-12-08 14:16:50 -08:00
parent 3f44613085
commit d90a83e510
2 changed files with 75 additions and 32 deletions

View file

@ -14,7 +14,7 @@ class Race < ApplicationRecord
case word
when /Native\s*American|American\s*Indian|Alaskan\s*Native|1/i
1
when /^Asian|Pacific\s*Island|Hawaiian|2/i
when /\bAsian|Pacific\s*Island|Hawaiian|2/i
2
when /Black|African\s*American|3/i
3