mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
chore: correctly detect missing grade header
This commit is contained in:
parent
1e71a2ed30
commit
8a3db1d214
1 changed files with 6 additions and 6 deletions
|
|
@ -61,12 +61,12 @@ class Cleaner
|
||||||
|
|
||||||
# If this is a student survey
|
# If this is a student survey
|
||||||
# Make sure it includes a 'Grade' header
|
# Make sure it includes a 'Grade' header
|
||||||
student_survey_is_missing_grade_header = headers
|
is_student_survey = headers.filter(&:present?)
|
||||||
.filter(&:present?)
|
.filter { |header| header.start_with? "s-" }
|
||||||
.filter { |header| header.start_with? "s-" }.count > 0 && !headers.find do |header|
|
.count > 0
|
||||||
header.match?(/grade/i)
|
|
||||||
end
|
has_grade_header = headers.filter(&:present?).find {|header| header.match?(/grade/i) }.present?
|
||||||
if student_survey_is_missing_grade_header
|
if is_student_survey && has_grade_header == false
|
||||||
puts "could not find the Grade header. Stopping execution"
|
puts "could not find the Grade header. Stopping execution"
|
||||||
exit
|
exit
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue