From 926f2a5350b296a6e01e27cdbaa3532c117b017a Mon Sep 17 00:00:00 2001 From: Matchu Date: Sun, 22 May 2011 13:10:29 -0400 Subject: [PATCH] improve swf image request enqueue on creation --- app/models/swf_asset.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/swf_asset.rb b/app/models/swf_asset.rb index 5b6000c2..cbe999bd 100644 --- a/app/models/swf_asset.rb +++ b/app/models/swf_asset.rb @@ -54,11 +54,11 @@ class SwfAsset < ActiveRecord::Base end end - def request_image_conversion!(klass=AssetImageConversionRequest) + def request_image_conversion! if image_requested? false else - Resque.enqueue(klass, self.id) + Resque.enqueue(AssetImageConversionRequest, self.id) self.image_requested = true save! true @@ -180,7 +180,7 @@ class SwfAsset < ActiveRecord::Base end after_create do - request_image_conversion!(AssetImageConversionRequest::OnCreation) + Resque.enqueue(AssetImageConversionRequest::OnCreation, self.id) end class DownloadError < Exception;end