Class: Sirius::ScheduleManager

Inherits:
Object
  • Object
show all
Defined in:
lib/sirius/schedule_manager.rb

Instance Method Summary collapse

Instance Method Details

#assign_peopleObject


36
37
38
# File 'lib/sirius/schedule_manager.rb', line 36

def assign_people
  perform_with_active_semesters(AssignPeople, :parallels)
end

#import_course_event_studentsObject


44
45
46
# File 'lib/sirius/schedule_manager.rb', line 44

def import_course_event_students
  perform_with_active_semesters(ImportCourseEventStudents, :course_events)
end

#import_course_eventsObject


40
41
42
# File 'lib/sirius/schedule_manager.rb', line 40

def import_course_events
  perform_with_active_semesters(ImportCourseEvents, :course_events)
end

#import_exam_studentsObject


52
53
54
# File 'lib/sirius/schedule_manager.rb', line 52

def import_exam_students
  perform_with_active_semesters(ImportExamStudents, :exams)
end

#import_examsObject


48
49
50
# File 'lib/sirius/schedule_manager.rb', line 48

def import_exams
  perform_with_active_semesters(ImportExams, :exams)
end

#import_parallels(fetch_all: true, page_size: 100) ⇒ Object


24
25
26
27
28
29
30
# File 'lib/sirius/schedule_manager.rb', line 24

def import_parallels(fetch_all: true, page_size: 100)
  active_semesters(:parallels).each do |sem|
    DB.transaction do
      ImportUpdatedParallels.perform(faculty_semester: sem, fetch_all: fetch_all, page_size: page_size)
    end
  end
end

#import_studentsObject


32
33
34
# File 'lib/sirius/schedule_manager.rb', line 32

def import_students
  perform_with_active_semesters(ImportStudents, :parallels)
end

#import_teacher_timetable_slotsObject


56
57
58
59
60
61
62
# File 'lib/sirius/schedule_manager.rb', line 56

def import_teacher_timetable_slots
  active_semesters(:teacher_timetable_slots).each do |sem|
    import = TeacherTimetableSlotImport.new(sem)
    import.run!
    import.shutdown!
  end
end

#plan_stored_parallelsObject


16
17
18
19
20
21
22
# File 'lib/sirius/schedule_manager.rb', line 16

def plan_stored_parallels
  active_semesters(:parallels).each do |semester|
    DB.transaction do
      EventPlanner.new.plan_semester(semester)
    end
  end
end

#renumber_eventsObject


64
65
66
# File 'lib/sirius/schedule_manager.rb', line 64

def renumber_events
  perform_with_active_semesters(RenumberEvents, :events)
end