Preload error template attributes in SubmissionsController
The join operation is okay, since a similar one is otherwise performed automatically by Rails
This commit is contained in:
@ -353,7 +353,7 @@ class SubmissionsController < ApplicationController
|
|||||||
def extract_errors
|
def extract_errors
|
||||||
results = []
|
results = []
|
||||||
if @testrun[:output].present?
|
if @testrun[:output].present?
|
||||||
@submission.exercise.execution_environment.error_templates.each do |template|
|
@submission.exercise.execution_environment.error_templates.left_joins(:error_template_attributes).includes(:error_template_attributes).each do |template|
|
||||||
pattern = Regexp.new(template.signature).freeze
|
pattern = Regexp.new(template.signature).freeze
|
||||||
results << StructuredError.create_from_template(template, @testrun[:output], @submission) if pattern.match(@testrun[:output])
|
results << StructuredError.create_from_template(template, @testrun[:output], @submission) if pattern.match(@testrun[:output])
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user