diff --git a/app/models/structured_error_attribute.rb b/app/models/structured_error_attribute.rb index 6eb17fc4..65bda05e 100644 --- a/app/models/structured_error_attribute.rb +++ b/app/models/structured_error_attribute.rb @@ -3,15 +3,13 @@ class StructuredErrorAttribute < ActiveRecord::Base belongs_to :error_template_attribute def self.create_from_template(attribute, structured_error, message_buffer) - match = false value = nil result = message_buffer.match(attribute.regex) if result != nil - match = true if result.captures.size > 0 value = result.captures[0] end end - self.create(structured_error: structured_error, error_template_attribute: attribute, value: value, match: match) + self.create(structured_error: structured_error, error_template_attribute: attribute, value: value, match: result != nil) end end