Merge pull request #235 from openHPI/remove_old_hints

Completely remove old hints connected to the execution environment
This commit is contained in:
rteusner
2018-11-30 15:41:01 +01:00
committed by GitHub
41 changed files with 54 additions and 744 deletions

View File

@@ -1,19 +0,0 @@
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

View File

@@ -10,7 +10,6 @@ class ExecutionEnvironment < ApplicationRecord
has_many :exercises
belongs_to :file_type
has_many :hints
has_many :error_templates
scope :with_exercises, -> { where('id IN (SELECT execution_environment_id FROM exercises)') }

View File

@@ -1,17 +0,0 @@
class Hint < ApplicationRecord
belongs_to :execution_environment
validates :execution_environment_id, presence: true
validates :locale, presence: true
validates :message, presence: true
validates :name, presence: true
validates :regular_expression, presence: true
def self.nested_resource?
true
end
def to_s
name
end
end