Class: LiveEvents::SyllabusEvent

Inherits:
BaseEvent show all
Defined in:
lib/canvas_sync/generators/templates/services/live_events/syllabus/syllabus_event.rb

Direct Known Subclasses

SyllabusUpdatedEvent

Instance Attribute Summary

Attributes inherited from BaseEvent

#payload

Instance Method Summary collapse

Methods inherited from BaseEvent

#local_canvas_id

Methods inherited from CanvasSync::Job

#create_job_log, #report_checker_wait_time

Instance Method Details

#perform(event_payload) ⇒ Object

The following is provided in the live events call:

course_id: course.global_id,
syllabus_body: LiveEvents.truncate(course.syllabus_body),
old_syllabus_body: LiveEvents.truncate(old_syllabus_body)



13
14
15
16
17
18
19
20
# File 'lib/canvas_sync/generators/templates/services/live_events/syllabus/syllabus_event.rb', line 13

def perform(event_payload)
  super
  attrs = {
    course_id: course.try(:id),
    syllabus_body: payload[:syllabus_body],
  }
  create_or_update(attrs)
end