mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
chore: when searching for dese id, split up pattern so that to be more explicit about the order in which to search out the columns that might have the dese ID we're looking for.
This commit is contained in:
parent
cddea60c8b
commit
b63c327d33
4 changed files with 12 additions and 57 deletions
|
|
@ -81,13 +81,9 @@ class SurveyItemValues
|
|||
|
||||
def dese_id
|
||||
@dese_id ||= begin
|
||||
dese_id = nil
|
||||
dese_headers = ["DESE ID", "Dese ID", "DeseId", "DeseID", "School", "school"]
|
||||
school_headers = headers.select { |header| /School-\s\w/.match(header) }
|
||||
dese_headers << school_headers
|
||||
dese_headers.flatten.each do |header|
|
||||
dese_id ||= row[header]
|
||||
end
|
||||
dese_id = value_from(pattern: /Dese\s*ID/i)
|
||||
dese_id ||= value_from(pattern: /^School$/i)
|
||||
dese_id ||= value_from(pattern: /School-\s*\w/i)
|
||||
|
||||
dese_id.to_i
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue