From 352e5f432919a7fae8f5efc8dcbafab5b975075d Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Sun, 17 Oct 2021 16:43:39 +0200 Subject: [PATCH] Clarify strategy creation in runner.rb with comment --- app/models/runner.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/runner.rb b/app/models/runner.rb index 861ba5ce..92650f2f 100644 --- a/app/models/runner.rb +++ b/app/models/runner.rb @@ -25,8 +25,10 @@ class Runner < ApplicationRecord runner = find_by(user: user, execution_environment: execution_environment) if runner.nil? runner = Runner.create(user: user, execution_environment: execution_environment) + # The `strategy` is added through the before_validation hook `:request_id`. raise Runner::Error::Unknown.new("Runner could not be saved: #{runner.errors.inspect}") unless runner.persisted? else + # This information is required but not persisted in the runner model. runner.strategy = strategy_class.new(runner.runner_id, runner.execution_environment) end