From dec3b203e94f737f94d4a6044aa190c0d36e3c37 Mon Sep 17 00:00:00 2001 From: Nathaniel Jones Date: Thu, 12 May 2011 17:01:41 -0500 Subject: [PATCH] Optimize Legacy Courier --- app/concerns/couriers/legacy.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/concerns/couriers/legacy.rb b/app/concerns/couriers/legacy.rb index 4a84dce..acca3b7 100644 --- a/app/concerns/couriers/legacy.rb +++ b/app/concerns/couriers/legacy.rb @@ -16,12 +16,14 @@ def execute id end def perform id + p = Photo.fields(:description, :filename, :title).find id + Net::HTTP.post_form( URI.parse(destination), { 'key' => key, - 'filename' => Photo.find(id).key, - 'description' => Photo.find(id).description, - 'title' => Photo.find(id).title } + 'filename' => p.key, + 'description' => p.description, + 'title' => p.title } ) end end