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 validate_section_ids section_ids, do_halt=true
        section_ids = [section_ids] if section_ids.is_a?(String)
        section_ids.each do |id|
          if not is_full_section_id? id
            return false if not do_halt
            error_msg = { error_code: 400, message: "Invalid section_id #{id}.", docs: "https://umd.io/courses/" }.to_json
            halt 400, error_msg
          end
        end
        return true
      end
def validate_section_ids section_ids , do_halt = true section_ids = [ section_ids ] if section_ids . is_a? ( String ) section_ids . each do | id | if not is_full_section_id? id return false if not do_halt error_msg = { error_code : 400 , message : "Invalid section_id #{id}." , docs : "https://umd.io/courses/" } . to_json halt 400 , error_msg end end return true end
generalize logic for checking if semester param valid
generalize logic for checking if semester param valid
section_ids
do_halt