aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-08-01 15:22:32 +0100
committerLouise Crow <louise.crow@gmail.com>2012-08-01 15:22:32 +0100
commitc9d8f483e727734a7f0afad9871df516e8c0470c (patch)
treef706fcc00cd82c69b90019dd00606905c7a83d43 /app/controllers
parent48c4c19c64c719af8d23c9d46111539b9d447b6d (diff)
parent1df6f6bfaf51c71c40bca4228cf3db5006306694 (diff)
Merge remote-tracking branch 'origin/develop' into develop
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/api_controller.rb11
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