added a job to clean up orphan uploads

This commit is contained in:
Régis Hanol
2013-10-14 14:27:41 +02:00
parent cf08d2c751
commit 4536b5fe04
7 changed files with 86 additions and 19 deletions

View File

@ -16,11 +16,16 @@ class CookedPostProcessor
end
def post_process
clean_up_reverse_index
post_process_attachments
post_process_images
post_process_oneboxes
end
def clean_up_reverse_index
PostUpload.delete_all(post_id: @post.id)
end
def post_process_attachments
attachments.each do |attachment|
href = attachment['href']