mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
feat: stop processing race or gender column if we encounter values we don't know about
This commit is contained in:
parent
cd6b503f44
commit
e8bc5eb11a
2 changed files with 15 additions and 3 deletions
|
|
@ -23,7 +23,13 @@ class Gender < ApplicationRecord
|
||||||
when %r{^#*N/*A$}i
|
when %r{^#*N/*A$}i
|
||||||
99
|
99
|
||||||
else
|
else
|
||||||
99
|
puts "************************************"
|
||||||
|
puts "******** ERROR **********"
|
||||||
|
puts ""
|
||||||
|
puts "Error parsing Gender column. '#{word}' is not a known value. Halting execution"
|
||||||
|
puts ""
|
||||||
|
puts "************************************"
|
||||||
|
exit
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ class Race < ApplicationRecord
|
||||||
3
|
3
|
||||||
when /Hispanic|Latinx|4/i
|
when /Hispanic|Latinx|4/i
|
||||||
4
|
4
|
||||||
when /White|Caucasian|5/i
|
when /White|Caucasian|Caucasion|5/i
|
||||||
5
|
5
|
||||||
when /Prefer not to disclose|6/i
|
when /Prefer not to disclose|6/i
|
||||||
6
|
6
|
||||||
|
|
@ -31,7 +31,13 @@ class Race < ApplicationRecord
|
||||||
when %r{^#*N/*A$}i
|
when %r{^#*N/*A$}i
|
||||||
nil
|
nil
|
||||||
else
|
else
|
||||||
99
|
puts "************************************"
|
||||||
|
puts "******** ERROR **********"
|
||||||
|
puts ""
|
||||||
|
puts "Error parsing race column. '#{word}' is not a known value. Halting execution"
|
||||||
|
puts ""
|
||||||
|
puts "************************************"
|
||||||
|
exit
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue