Class: TeacherChangeScheduleException

Inherits:
ScheduleException show all
Defined in:
app/models/teacher_change_schedule_exception.rb

Constant Summary collapse

USERNAME_LIST_FORMAT =

Checks for {username,12345,foo} with optional spaces around braces and commas. An empty list {} is also allowed.

/^ *{ *(\w+(?: *, *\w+)*)? *} *$/.freeze
USERNAME_DELIMITER =

username list delimiters - comas with optional spaces

/ *, */.freeze

Instance Method Summary collapse

Methods inherited from ScheduleException

#affects?, #apply, #period, #period=

Instance Method Details

#apply_people_assign(event) ⇒ Object


10
11
12
13
14
# File 'app/models/teacher_change_schedule_exception.rb', line 10

def apply_people_assign(event)
  if event.teacher_ids != parse_username_list(options['teacher_ids'])
    event.update(teacher_ids: options['teacher_ids'])
  end
end