Skip to content

Commit

Permalink
Merge pull request #24140 from code-dot-org/import-kansas-course-offe…
Browse files Browse the repository at this point in the history
…rings

Import Kansas course offerings
  • Loading branch information
sureshc committed Aug 7, 2018
2 parents b3c008a + 5b13561 commit 65b5461
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions dashboard/app/models/census/state_cs_offering.rb
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

0 comments on commit 65b5461

Please sign in to comment.