From 89459d3902583fa3d6dad78462d2bf2fa6f94db6 Mon Sep 17 00:00:00 2001 From: Robin Houston Date: Mon, 18 Jun 2012 12:55:11 +0100 Subject: API controller tests all pass --- app/controllers/api_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/controllers/api_controller.rb') diff --git a/app/controllers/api_controller.rb b/app/controllers/api_controller.rb index c1156845d..524aa44b7 100644 --- a/app/controllers/api_controller.rb +++ b/app/controllers/api_controller.rb @@ -139,11 +139,11 @@ class ApiController < ApplicationController attachment_hashes = [] (attachments || []).each_with_index do |attachment, i| filename = File.basename(attachment.original_filename) - body = attachment.read - content_type = AlaveteliFileTypes.filename_and_content_to_mimetype(filename, body) || 'application/octet-stream' + attachment_body = attachment.read + content_type = AlaveteliFileTypes.filename_and_content_to_mimetype(filename, attachment_body) || 'application/octet-stream' attachment_hashes.push( :content_type => content_type, - :body => body, + :body => attachment_body, :filename => filename ) end -- cgit v1.2.3