Commit Graph

2 Commits

Author SHA1 Message Date
Cody Cutrer 809904d8b6 add frozen_string_literal comment to migrations
Change-Id: Idf4ddb29567c1dfab9f01b09c7a1056367ae7b44
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/261814
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2021-03-30 18:14:36 +00:00
Derek Bender 4ab8d4f78a add anonymous_id to submissions
Closes: GRADE-892

test plan
 - anonymous_id is present on the submissions table
 - cannot create a submission with the same assignment id and
   anonymous_id.

    account = Account.default
    course = account.courses.create!
    assignment = course.assignments.create!
    first_user = User.create!
    second_user = User.create!
    assignment.submissions.create!(
      user: first_user,
      anonymous_id: 'abcd1'
    )
    # fails
    assignment.submissions.create!(
      user: second_user,
      anonymous_id: 'abcd1'
    )

The error message is of the form: `ActiveRecord::RecordNotUnique:
PG::UniqueViolation: ERROR:  duplicate key value violates unique
constraint "index_submissions_on_assignment_id_and_anonymous_id"`

Change-Id: I74dc28d4e5a226960750647774f20c67d2772f1c
Reviewed-on: https://gerrit.instructure.com/142344
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Tested-by: Jenkins
QA-Review: Indira Pai <ipai@instructure.com>
Product-Review: Keith T. Garner <kgarner@instructure.com>
2018-03-07 01:33:13 +00:00