feat: stop processing race or gender column if we encounter values we don't know about

This commit is contained in:
Nelson Jovel 2024-06-20 12:48:36 -07:00
parent cd6b503f44
commit e8bc5eb11a
2 changed files with 15 additions and 3 deletions

View file

@ -23,7 +23,13 @@ class Gender < ApplicationRecord
when %r{^#*N/*A$}i
99
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

View file

@ -20,7 +20,7 @@ class Race < ApplicationRecord
3
when /Hispanic|Latinx|4/i
4
when /White|Caucasian|5/i
when /White|Caucasian|Caucasion|5/i
5
when /Prefer not to disclose|6/i
6
@ -31,7 +31,13 @@ class Race < ApplicationRecord
when %r{^#*N/*A$}i
nil
else
99
puts "************************************"
puts "******** ERROR **********"
puts ""
puts "Error parsing race column. '#{word}' is not a known value. Halting execution"
puts ""
puts "************************************"
exit
end
end