Merge pull request #7246 from G-Chubinidze/gc_SCI_10200

Inventory export for checklists with return delimiter should escape the return sign [SCI-10200]
This commit is contained in:
aignatov-bio 2024-04-26 10:12:01 +02:00 committed by GitHub
commit 6d74152414
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -22,7 +22,7 @@ class RepositoryChecklistValue < ApplicationRecord
EXTRA_PRELOAD_INCLUDE = :repository_checklist_items EXTRA_PRELOAD_INCLUDE = :repository_checklist_items
def formatted(separator: ' | ') def formatted(separator: ' | ')
repository_checklist_items.pluck(:data).join(separator) repository_checklist_items.pluck(:data).join(separator).gsub("\n", "\\n")
end end
def export_formatted def export_formatted

View file

@ -44,7 +44,10 @@ class SpreadsheetParser
if row && i.zero? if row && i.zero?
header = row header = row
else else
columns = row escaped_row = row.map do |cell|
cell.gsub("\\n", "\n")
end
columns = escaped_row
end end
end end