aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/request_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r--app/controllers/request_controller.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index ac92801b9..e5950c41d 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -926,10 +926,12 @@ class RequestController < ApplicationController
Zip::ZipFile.open(file_path, Zip::ZipFile::CREATE) do |zipfile|
file_info = make_request_summary_file(info_request)
zipfile.get_output_stream(file_info[:filename]) { |f| f.puts(file_info[:data]) }
+ message_index = 0
info_request.incoming_messages.each do |message|
next unless message.user_can_view?(authenticated_user)
+ message_index += 1
message.get_attachments_for_display.each do |attachment|
- filename = "#{attachment.url_part_number}_#{attachment.display_filename}"
+ filename = "#{message_index}_#{attachment.url_part_number}_#{attachment.display_filename}"
zipfile.get_output_stream(filename) { |f| f.puts(attachment.body) }
end
end