Files
codeocean/app/models/remote_evaluation_mapping.rb
Sebastian Serth 977fa4539e Check polymorphic type in validations
* Previously, some models had "duplicated" `belongs_to` associations, which were now removed (and replaced by the `include Creation`).
2023-08-24 19:32:06 +02:00

14 lines
350 B
Ruby

# frozen_string_literal: true
# TODO: reference to lti_param_model
class RemoteEvaluationMapping < ApplicationRecord
include Creation
before_create :generate_token, unless: :validation_token?
belongs_to :exercise
belongs_to :study_group, optional: true
def generate_token
self.validation_token = SecureRandom.urlsafe_base64
end
end