Files
codeocean/app/models/remote_evaluation_mapping.rb
Sebastian Serth bb10e191ed Specify ExternalUser as class for user in RemoteEvaluationMapping
Otherwise, the download of submissions will no longer work in Rails 5
2018-11-22 18:57:58 +01:00

10 lines
304 B
Ruby

# todo: reference to lti_param_model
class RemoteEvaluationMapping < ApplicationRecord
before_create :generate_token, unless: :validation_token?
belongs_to :exercise
belongs_to :user, class_name: 'ExternalUser'
def generate_token
self.validation_token = SecureRandom.urlsafe_base64
end
end