diff --git a/app/models/execution_environment.rb b/app/models/execution_environment.rb index d4138000..3ca6da6c 100644 --- a/app/models/execution_environment.rb +++ b/app/models/execution_environment.rb @@ -16,7 +16,7 @@ class ExecutionEnvironment < ApplicationRecord has_many :exercises belongs_to :file_type has_many :error_templates - belongs_to :testrun_execution_environment, optional: true, dependent: :destroy + has_many :testrun_execution_environments, dependent: :destroy scope :with_exercises, -> { where('id IN (SELECT execution_environment_id FROM exercises)') }