Class: LiveEvents::EnrollmentEvent
- Inherits:
-
BaseEvent
- Object
- ActiveJob::Base
- CanvasSync::Job
- BaseEvent
- LiveEvents::EnrollmentEvent
- Defined in:
- lib/canvas_sync/generators/templates/services/live_events/enrollment_event.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#enrollment ⇒ Object
Returns the value of attribute enrollment.
Attributes inherited from BaseEvent
#metadata, #payload, #raw_payload
Attributes inherited from CanvasSync::Job
Instance Method Summary collapse
Methods inherited from BaseEvent
Methods inherited from CanvasSync::Job
#create_job_log, #report_checker_wait_time, #update_or_create_model
Instance Attribute Details
#enrollment ⇒ Object
Returns the value of attribute enrollment.
5 6 7 |
# File 'lib/canvas_sync/generators/templates/services/live_events/enrollment_event.rb', line 5 def enrollment @enrollment end |
Instance Method Details
#process ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/canvas_sync/generators/templates/services/live_events/enrollment_event.rb', line 7 def process() @enrollment = Enrollment.where(canvas_id: local_canvas_id(payload[:enrollment_id])).first_or_initialize enrollment.canvas_course_id = local_canvas_id(payload[:course_id]) enrollment.sync_from_api if enrollment.user.nil? u = User.new(canvas_id: enrollment.canvas_user_id) u.sync_from_api end end |