Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import Kansas course offerings #24140

Merged
merged 1 commit into from
Aug 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions dashboard/app/models/census/state_cs_offering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Census::StateCsOffering < ApplicationRecord
IA
ID
IN
KS
KY
LA
MA
Expand Down Expand Up @@ -86,6 +87,8 @@ def self.construct_state_school_id(state_code, row_hash)
when 'IN'
# Don't raise an error if school does not exist because the logic that invokes this method skips these.
School.find_by(id: row_hash['NCES'])&.state_school_id
when 'KS'
row_hash['state_school_id']
when 'KY'
row_hash['State School ID']
when 'LA'
Expand Down Expand Up @@ -242,6 +245,16 @@ def self.construct_state_school_id(state_code, row_hash)
4586
).freeze

KS_COURSE_CODES = %w(
10152
10155
10156
10153
10154
10199
10197
).freeze

KY_COURSE_CODES = %w(
110711
110701
Expand Down Expand Up @@ -410,6 +423,8 @@ def self.get_courses(state_code, row_hash)
when 'IN'
# A column per CS course with a value of 'Y' if the course is offered.
IN_COURSE_CODES.select {|course| row_hash[course] == 'Y'}
when 'KS'
KS_COURSE_CODES.select {|course| course == row_hash['course']}
when 'KY'
KY_COURSE_CODES.select {|course| course == row_hash['Course']}
when 'LA'
Expand Down