Add StudyGroup to RemoteEvaluationMapping

This commit is contained in:
Sebastian Serth
2021-04-26 16:40:34 +02:00
parent 91a0e4a7d5
commit 4958f5b9a9
7 changed files with 20 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ class RemoteEvaluationMapping < ApplicationRecord
before_create :generate_token, unless: :validation_token?
belongs_to :exercise
belongs_to :user, polymorphic: true
belongs_to :study_group, optional: true
def generate_token
self.validation_token = SecureRandom.urlsafe_base64