Update schema to reflect re-usable error_template_attributes, descriptions, hints, and sorting

This commit is contained in:
Maximilian Grundke
2017-07-11 19:22:12 +02:00
parent d2a089d057
commit 872611bff6
6 changed files with 30 additions and 5 deletions

View File

@@ -1,3 +1,4 @@
class ErrorTemplate < ActiveRecord::Base
belongs_to :execution_environment
has_and_belongs_to_many :error_template_attributes
end

View File

@@ -1,3 +1,3 @@
class ErrorTemplateAttribute < ActiveRecord::Base
belongs_to :error_template
has_and_belongs_to_many :error_template
end

View File

@@ -11,6 +11,7 @@ class ExecutionEnvironment < ActiveRecord::Base
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)') }