Fix Runner access for programming groups

* We also rename the corresponding columns in the Runner model, so that for polymorphic association gets clear.
This commit is contained in:
Sebastian Serth
2023-08-20 20:32:41 +02:00
committed by Sebastian Serth
parent 977fa4539e
commit a1941336d9
8 changed files with 36 additions and 25 deletions

View File

@ -7,6 +7,7 @@ class ProgrammingGroup < ApplicationRecord
has_many :external_users, through: :programming_group_memberships, source_type: 'ExternalUser', source: :user
has_many :internal_users, through: :programming_group_memberships, source_type: 'InternalUser', source: :user
has_many :testruns, through: :submissions
has_many :runners, as: :contributor, dependent: :destroy
belongs_to :exercise
validate :group_size