mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
feat: Support SIS categories for race in the form of 'White and Asian'
or 'Black, Asian, and white'
This commit is contained in:
parent
0931950eaf
commit
883731bce1
1 changed files with 6 additions and 1 deletions
|
|
@ -138,7 +138,12 @@ class SurveyItemValues
|
|||
race_codes ||= value_from(pattern: /Race\s*-\s*Qcodes/i)
|
||||
race_codes ||= value_from(pattern: /RACE/i) || ""
|
||||
race_codes ||= []
|
||||
race_codes = race_codes.split(",").map { |race| Race.qualtrics_code_from(race) }.map(&:to_i)
|
||||
race_codes = race_codes.split(",")
|
||||
.map do |word|
|
||||
word.split("and")
|
||||
end.flatten
|
||||
.reject(&:blank?)
|
||||
.map { |race| Race.qualtrics_code_from(race) }.map(&:to_i)
|
||||
race_codes = race_codes.reject { |code| code == 5 } if hispanic == "true" && race_codes.count == 1
|
||||
race_codes = race_codes.push(4) if hispanic == "true"
|
||||
process_races(codes: race_codes)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue