# # # AUTO GENERATED LIVE EVENT # This was auto generated by the CanvasSync Gem. # You can customize it as needed, but make sure you test # any changes you make to the auto generated methods. # # LiveEvent message formats can be found at https://canvas.instructure.com/doc/api/file.live_events.html # In the general case, LiveEvent message content should not be trusted - it is highly possible that events may # arrive out of order. Most of the CanvasSync LiveEvent templates solve this by always fetching the object from the API. # module LiveEvents class ModuleEvent < LiveEvents::BaseEvent def process return unless payload["context_type"] == "Course" context_module = ContextModule.find_or_initialize_by(canvas_id: payload["module_id"]) context_module.sync_from_api end end class ModuleCreatedEvent < LiveEvents::ModuleEvent; end class ModuleUpdatedEvent < LiveEvents::ModuleEvent; end end