Add user_type to RemoteEvaluationMappings

This commit is contained in:
Sebastian Serth
2018-11-26 17:56:07 +01:00
parent bb10e191ed
commit 1131d08e2b
5 changed files with 16 additions and 9 deletions

View File

@@ -2,9 +2,9 @@
class RemoteEvaluationMapping < ApplicationRecord
before_create :generate_token, unless: :validation_token?
belongs_to :exercise
belongs_to :user, class_name: 'ExternalUser'
belongs_to :user, polymorphic: true
def generate_token
self.validation_token = SecureRandom.urlsafe_base64
end
end
end