Files
codeocean/app/models/remote_evaluation_mapping.rb
Sebastian Serth 3c7e9176a2 Daily Rubocop
2021-04-30 12:06:13 +02:00

14 lines
369 B
Ruby

# frozen_string_literal: true
# TODO: reference to lti_param_model
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
end
end