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

rpp-main
Nelson Jovel 1 year ago
parent cf50c43109
commit 294e9c5ce5

@ -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…
Cancel
Save