de-dup preloaded student ids for assignment overrides

test plan:
* have a course with two sections
* add a student to both sections
* create an assignment with an overridden due
 date just for the student
* reloading the assignment edit page shouldn't
 show the student's name twice

closes #CNVS-40372

Change-Id: I2df52e0a6ae148f5eeca40e6c91054e025076fd9
Reviewed-on: https://gerrit.instructure.com/133167
Tested-by: Jenkins
Reviewed-by: Mysti Sadler <mysti@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
This commit is contained in:
James Williams 2017-11-17 09:51:43 -07:00
parent 4824f659ec
commit ef297d0538
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ module AssignmentOverrideApplicator
scope.where(user_id: visible_user_ids)
end
scope.pluck(:assignment_override_id, :user_id).each do |ov_id, user_id|
scope.distinct.pluck(:assignment_override_id, :user_id).each do |ov_id, user_id|
override_ids_to_student_ids[ov_id] ||= []
override_ids_to_student_ids[ov_id] << user_id
end