Browse Source

persist bulk upload error category

pull/1358/head
Phil Lee 3 years ago
parent
commit
d47d7cab71
  1. 1
      app/services/bulk_upload/lettings/validator.rb
  2. 5
      spec/services/bulk_upload/lettings/validator_spec.rb

1
app/services/bulk_upload/lettings/validator.rb

@ -168,6 +168,7 @@ class BulkUpload::Lettings::Validator
row:,
cell: "#{cols[field_number_for_attribute(error.attribute) - col_offset + 1]}#{row}",
col: cols[field_number_for_attribute(error.attribute) - col_offset + 1],
category: error.options[:category],
)
end
end

5
spec/services/bulk_upload/lettings/validator_spec.rb

@ -51,6 +51,11 @@ RSpec.describe BulkUpload::Lettings::Validator do
expect(error.row).to eql("7")
expect(error.cell).to eql("L7")
expect(error.col).to eql("L")
expect(error.category).to be_nil
error = BulkUploadError.order(:row, :field).find_by(field: "field_111")
expect(error.category).to eql("setup")
end
end

Loading…
Cancel
Save