improve swf image request enqueue on creation
This commit is contained in:
parent
b13fd7ae99
commit
926f2a5350
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue