Apply automatic rubocop fixes
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class StructuredError < ApplicationRecord
|
||||
belongs_to :error_template
|
||||
belongs_to :submission
|
||||
@ -5,8 +7,8 @@ class StructuredError < ApplicationRecord
|
||||
has_many :structured_error_attributes
|
||||
|
||||
def self.create_from_template(template, message_buffer, submission)
|
||||
instance = self.create(error_template: template, submission: submission)
|
||||
template.error_template_attributes.each do | attribute |
|
||||
instance = create(error_template: template, submission: submission)
|
||||
template.error_template_attributes.each do |attribute|
|
||||
StructuredErrorAttribute.create_from_template(attribute, instance, message_buffer)
|
||||
end
|
||||
instance
|
||||
@ -14,7 +16,7 @@ class StructuredError < ApplicationRecord
|
||||
|
||||
def hint
|
||||
content = error_template.hint
|
||||
structured_error_attributes.each do | attribute |
|
||||
structured_error_attributes.each do |attribute|
|
||||
content.sub! "{{#{attribute.error_template_attribute.key}}}", attribute.value if attribute.match
|
||||
end
|
||||
content
|
||||
|
Reference in New Issue
Block a user