Add foreign keys and an index to StructuredError(Attributes)
These changes will ensure a better data consistency and faster access. We further ensure that records should be deleted properly.
This commit is contained in:
@ -4,7 +4,7 @@ class StructuredError < ApplicationRecord
|
||||
belongs_to :error_template
|
||||
belongs_to :submission
|
||||
|
||||
has_many :structured_error_attributes
|
||||
has_many :structured_error_attributes, dependent: :destroy
|
||||
|
||||
def self.create_from_template(template, message_buffer, submission)
|
||||
create(
|
||||
|
@ -15,7 +15,7 @@ class Submission < ApplicationRecord
|
||||
belongs_to :study_group, optional: true
|
||||
|
||||
has_many :testruns
|
||||
has_many :structured_errors
|
||||
has_many :structured_errors, dependent: :destroy
|
||||
has_many :comments, through: :files
|
||||
|
||||
belongs_to :external_users, lambda {
|
||||
|
Reference in New Issue
Block a user