Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor a method so the Assignments#show action is faster
In AssignmentsController#show we [email protected]_assignment_group which was causing this to be called and also causing a: SELECT "assignment_groups".* FROM "assignment_groups" WHERE "assignment_groups"."context_id" = 1 AND "assignment_groups"."context_type" = 'Course' AND (assignment_groups.workflow_state<>'deleted') ORDER BY assignment_groups.position, CAST(LOWER(replace(assignment_groups.name, '\', '\\')) AS bytea) …even if the assignment already had an assignment_group_id We should be able to avoid doing that query if we already have an assignment_group_id Test plan: * for an assignment that already has an assignment_grou_id * go to AssignmentsController#show (with or without a2 on) * it should not run that ^ query Change-Id: I64d1d845c50a4cf3e56d2b750954c5a8a778c265 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/218101 Tested-by: Service Cloud Jenkins <[email protected]> Tested-by: Jenkins Reviewed-by: Steven Burnett <[email protected]> QA-Review: Ryan Shaw <[email protected]> Product-Review: Ryan Shaw <[email protected]>
- Loading branch information