app/helpers/courses_helpers.rb
# Takes a section row and formats it into a response
Takes a section row and formats it into a response
Takes a section row and formats it into a response
def clean_section db, semester, row
        row['meetings'] = ::JSON.parse(row['meetings'])
        row['meetings'].each do |meeting|
          meeting.delete('start_seconds')
          meeting.delete('end_seconds')
        end
        row['course'] = row['course_id']
        row.delete('course_id')
        row['instructors'] = PG::TextDecoder::Array.new.decode(row['instructors'])
        row.delete('id')
        row
      end
def clean_section db , semester , row row [ 'meetings' ] = :: JSON . parse ( row [ 'meetings' ] ) row [ 'meetings' ] . each do | meeting | meeting . delete ( 'start_seconds' ) meeting . delete ( 'end_seconds' ) end row [ 'course' ] = row [ 'course_id' ] row . delete ( 'course_id' ) row [ 'instructors' ] = PG :: TextDecoder :: Array . new . decode ( row [ 'instructors' ] ) row . delete ( 'id' ) row end
Takes a section row and formats it into a response
Takes a section row and formats it into a response
db
semester
row