Merge pull request #235 from openHPI/remove_old_hints
Completely remove old hints connected to the execution environment
This commit is contained in:
@@ -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
|
@@ -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)') }
|
||||
|
@@ -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
|
Reference in New Issue
Block a user