diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-07-17 10:28:53 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-07-17 10:28:53 +0100 |
commit | 8e24786e42d28e47d413d1470628a719135d1dd2 (patch) | |
tree | 611486045b545507f849e66b4c856ec48229b0ef | |
parent | 05082cb1cace60572911c875673589aea47fd7f0 (diff) |
Oh dear, a "revert revert revert" that reverts the "revert revert" that should never have been pushed in the first place. Sorry!
Revert "Revert "Revert "In the API, when parsing posted responses, assume all multipart mail parts that are Tempfiles are attachments"""
This reverts commit 49ff1a1c0304cd292d3eae80dc0b91b2f83727b9.
-rw-r--r-- | app/controllers/api_controller.rb | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index a7853c787..718c31e6f 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -71,18 +71,10 @@ class ApiController < ApplicationController end - def _get_attachments_from_params(params) - attachments = [] - params.each_pair do |k, v| - attachments << v if v.is_a? Tempfile - end - return attachments - end - def add_correspondence request = InfoRequest.find(params[:id]) json = ActiveSupport::JSON.decode(params[:correspondence_json]) - attachments = _get_attachments_from_params(params) + attachments = params[:attachments] direction = json["direction"] body = json["body"] @@ -155,6 +147,7 @@ class ApiController < ApplicationController :filename => filename ) end + mail = RequestMailer.create_external_response(request, body, sent_at, attachment_hashes) request.receive(mail, mail.encoded, true) end |