don't send notifications for added observer enrollments in datafix

refs #CNVS-16391

Change-Id: Ib2d0044b96fe51cc5f232655b6b30ba1f45bd2ca
Reviewed-on: https://gerrit.instructure.com/44844
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
This commit is contained in:
James Williams 2014-11-24 14:28:00 -07:00
parent c8a02df706
commit 8c9fe2c690
1 changed files with 10 additions and 1 deletions

View File

@ -5,7 +5,16 @@ module DataFixup::LinkMissingSisObserverEnrollments
if enrollment.linked_enrollment_for(uo.observer).nil? && uo.observer.can_be_enrolled_in_course?(enrollment.course)
new_enrollment = uo.observer.observer_enrollments.build
new_enrollment.associated_user_id = enrollment.user_id
new_enrollment.update_from(enrollment)
new_enrollment.course_id = enrollment.course_id
new_enrollment.workflow_state = enrollment.workflow_state
new_enrollment.start_at = enrollment.start_at
new_enrollment.end_at = enrollment.end_at
new_enrollment.course_section_id = enrollment.course_section_id
new_enrollment.root_account_id = enrollment.root_account_id
new_enrollment.save_without_broadcasting!
uo.observer.touch
end
end
end