fix(piece_justicative): don't modify validator accepted formats in place

Previous implementation caused to add multiple times ".acidcsa".
This commit is contained in:
Colin Darie 2022-11-09 09:50:05 +01:00
parent 3e992589c5
commit 84ca01bdf7

View file

@ -110,10 +110,8 @@ class Attachment::EditComponent < ApplicationComponent
end
def accept_content_type
list = content_type_validator.options[:in]
if list.include?("application/octet-stream")
list.push(".acidcsa")
end
list = content_type_validator.options[:in].dup
list << ".acidcsa" if list.include?("application/octet-stream")
list.join(', ')
end