aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/incoming_message.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/incoming_message.rb')
-rw-r--r--app/models/incoming_message.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 3b2f09035..d976d318b 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -597,7 +597,10 @@ class IncomingMessage < ActiveRecord::Base
attachments = []
attachment_attributes.each do |attrs|
attachment = self.foi_attachments.find_or_create_by_hexdigest(:hexdigest => attrs[:hexdigest])
+ body = attrs.delete(:body)
attachment.update_attributes(attrs)
+ # Set the body separately as its handling can depend on the value of charset
+ attachment.body = body
attachment.save!
attachments << attachment.id
end