1
0
Fork 0
forked from OpenNeo/impress

improve swf image request enqueue on creation

This commit is contained in:
Emi Matchu 2011-05-22 13:10:29 -04:00
parent b13fd7ae99
commit 926f2a5350

View file

@ -54,11 +54,11 @@ class SwfAsset < ActiveRecord::Base
end end
end end
def request_image_conversion!(klass=AssetImageConversionRequest) def request_image_conversion!
if image_requested? if image_requested?
false false
else else
Resque.enqueue(klass, self.id) Resque.enqueue(AssetImageConversionRequest, self.id)
self.image_requested = true self.image_requested = true
save! save!
true true
@ -180,7 +180,7 @@ class SwfAsset < ActiveRecord::Base
end end
after_create do after_create do
request_image_conversion!(AssetImageConversionRequest::OnCreation) Resque.enqueue(AssetImageConversionRequest::OnCreation, self.id)
end end
class DownloadError < Exception;end class DownloadError < Exception;end