app/controllers/course_controller.rb
def find_by_number(id)
    id = @unilib.course_normalize(id)
    course = course_from_cache(id)

    if not course
      course = @unilib.find_by_number(id, @user.semester.year, @user.semester.semester, @user.semester.university.id)
      return nil if not course
      save_course_to_cache course
      course = course_from_cache(course['number'])
    end

    # Add events to course
    course['events'] = load_events(course['id'])
    # Add reception hours of staff
    course['reception_hours'] = load_recepetion_hours(course)
    course
  end
# Find specific course by number and return its json or nil
Find specific course by number and return its json or nil
Find specific course by number and return its json or nil
def find_by_number(id)
    id = @unilib.course_normalize(id)
    course = course_from_cache(id)
    if not course
      course = @unilib.find_by_number(id, @user.semester.year, @user.semester.semester, @user.semester.university.id)
      return nil if not course
      save_course_to_cache course
      course = course_from_cache(course['number'])
    end
    course['events'] = load_events(course['id'])
    course['reception_hours'] = load_recepetion_hours(course)
    course
  end
def find_by_number ( id ) id = @unilib . course_normalize ( id ) course = course_from_cache ( id ) if not course course = @unilib . find_by_number ( id , @user . semester . year , @user . semester . semester , @user . semester . university . id ) return nil if not course save_course_to_cache course course = course_from_cache ( course [ 'number' ] ) end course [ 'events' ] = load_events ( course [ 'id' ] ) course [ 'reception_hours' ] = load_recepetion_hours ( course ) course end
Find specific course by number and return its json or nil
Find specific course by number and return its json or nil
# Add events to course # Add reception hours of staff
id