Apply automatic rubocop fixes

This commit is contained in:
Sebastian Serth
2021-05-14 10:51:44 +02:00
parent fe4000916c
commit 6cbecb5b39
440 changed files with 2705 additions and 1853 deletions

View File

@ -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