this removes our db triggers and instead uses AR callbacks in conjunction
with after_transaction_commit. this way we won't get processes fighting
over the same assigments tuple.
note that we can't actually remove the hairtrigger gem until we clean up/
remove all those old migrations :-/
test plan:
1. tests should pass (and cover 2. and 3.), but just to be sure...
2. ensure that "assignments needing grading" counts work as expected
3. ensure that quizzes w/ essays don't show as graded in the speedgrader
until the essays have been graded
Change-Id: I6af67605b18378bd3c181c710ba5027ec944394b
Reviewed-on: https://gerrit.instructure.com/43202
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
fixes two issue with the ungraded count logic:
1. the submission triggers updated the count regardless of the enrollment
status (or existence). teachers or people not even in the course could
cause the count to change (e.g. by taking/previewing a quiz)
2. the enrollment triggers did not factor in the enrollment type. so
teachers/tas (un)enrolling in the course would cause the count to
change if they had any submissions (e.g. from a quiz)
test plan:
1. create a quiz with essay questions (so that submissions will need to be
graded)
2. enroll a student in multiple sections in the course
3. take the quiz as the student
4. take the quiz as the teacher
5. take the quiz as an admin not in the course
6. confirm the ungraded count is just 1
7. unenroll the teacher
8. confirm the ungraded count is still 1
9. unenroll the student
10. confirm the ungraded count is now 0
Change-Id: I11dbf3915d79f9820267469fad8949abfa008e14
Reviewed-on: https://gerrit.instructure.com/10451
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>