delete tmp dir after converting swfs

This commit is contained in:
Emi Matchu 2011-06-10 14:45:33 -04:00
parent cf94c7ef59
commit 9eaeadaa8c

View file

@ -22,8 +22,12 @@ class SwfAsset < ActiveRecord::Base
LOCAL_ASSET_DIR.join(local_path_within_outfit_swfs) LOCAL_ASSET_DIR.join(local_path_within_outfit_swfs)
end end
def swf_image_dir
@swf_image_dir ||= Rails.root.join('tmp', 'asset_images_before_upload', self.id.to_s)
end
def swf_image_path(size) def swf_image_path(size)
Rails.root.join('tmp', 'asset_images_before_upload', self.id.to_s, "#{size.join 'x'}.png") swf_image_dir.join("#{size.join 'x'}.png")
end end
def after_swf_conversion(images) def after_swf_conversion(images)
@ -41,6 +45,7 @@ class SwfAsset < ActiveRecord::Base
FileUtils.rm path FileUtils.rm path
end end
FileUtils.rmdir swf_image_dir
end end
def s3_key(size) def s3_key(size)