app/helpers/courses_helpers.rb
# generalize logic for checking if semester param valid
generalize logic for checking if semester param valid
generalize logic for checking if semester param valid
def clean_professor db, semester, row
        id = row.delete('id')
        row['courses'] = PG::TextDecoder::Array.new.decode(row['courses'])
        row['departments'] = PG::TextDecoder::Array.new.decode(row['departments'])
        row['semester'] = [row['semester']]
        return row
      end
def clean_professor db , semester , row id = row . delete ( 'id' ) row [ 'courses' ] = PG :: TextDecoder :: Array . new . decode ( row [ 'courses' ] ) row [ 'departments' ] = PG :: TextDecoder :: Array . new . decode ( row [ 'departments' ] ) row [ 'semester' ] = [ row [ 'semester' ] ] return row end
generalize logic for checking if semester param valid
generalize logic for checking if semester param valid
db
semester
row