From f77e6d9df8a58bdba18a04527ae75be5ae0757e6 Mon Sep 17 00:00:00 2001 From: Felix Auringer <48409110+felixauringer@users.noreply.github.com> Date: Tue, 14 Sep 2021 18:02:22 +0300 Subject: [PATCH] Simplify code in runner model --- app/models/runner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/runner.rb b/app/models/runner.rb index 543452d7..861ba5ce 100644 --- a/app/models/runner.rb +++ b/app/models/runner.rb @@ -20,7 +20,7 @@ class Runner < ApplicationRecord end def self.for(user, exercise) - execution_environment = ExecutionEnvironment.find(exercise.execution_environment_id) + execution_environment = exercise.execution_environment runner = find_by(user: user, execution_environment: execution_environment) if runner.nil?