filter assignments in addition to submissions for DueDateCacher
helps postgres avoid a temp table Change-Id: I33ffd1f3d35523eb350a8adff1a54eff799c95da Reviewed-on: https://gerrit.instructure.com/30297 Reviewed-by: Jacob Fugal <jacob@instructure.com> Tested-by: Jenkins <jenkins@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
dbcf296348
commit
3cb81b8bb5
|
@ -77,7 +77,7 @@ class DueDateCacher
|
|||
"submissions.assignment_id",
|
||||
"assignments.due_at",
|
||||
"CAST(#{Submission.sanitize(false)} AS #{cast}) AS overridden"
|
||||
]).joins(:assignment).to_sql})")
|
||||
]).joins(:assignment).where(assignments: { id: @assignments }).to_sql})")
|
||||
|
||||
# create an ActiveRecord class around that temp table for the update_all
|
||||
scope = Class.new(ActiveRecord::Base) do
|
||||
|
|
Loading…
Reference in New Issue