Skip to content

Commit

Permalink
Improve performance of Assignment#current_grader_data
Browse files Browse the repository at this point in the history
  • Loading branch information
david-yz-liu committed Jul 9, 2023
1 parent 2d3f50d commit 97082e4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions app/models/assignment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1030,10 +1030,7 @@ def current_grader_data
groups[[group_id, group_name, count]]
groups[[group_id, group_name, count]] << { grader: ta, hidden: hidden } unless ta.nil?
end
group_sections = {}
self.groupings.includes(:section).find_each do |g|
group_sections[g.id] = g.section&.id
end
group_sections = self.groupings.left_outer_joins(:section).pluck('groupings.id', 'sections.id').to_h
groups = groups.map do |k, v|
{
_id: k[0],
Expand Down

0 comments on commit 97082e4

Please sign in to comment.