Fix error, submission, hints and help views

This commit is contained in:
Sebastian Serth
2018-09-30 13:16:07 +02:00
parent 15b1670511
commit 9666683bd7
18 changed files with 88 additions and 79 deletions

View File

@ -0,0 +1,19 @@
module CodeOcean
class Error < ApplicationRecord
belongs_to :execution_environment
scope :for_execution_environment, ->(execution_environment) { where(execution_environment_id: execution_environment.id) }
scope :grouped_by_message, -> { select('MAX(created_at) AS created_at, MAX(id) AS id, message, COUNT(id) AS count').group(:message).order('count DESC') }
validates :execution_environment_id, presence: true
validates :message, presence: true
def self.nested_resource?
true
end
def to_s
id.to_s
end
end
end