From ab9c0d13d7c0fc33feeb69e6041a0429a077f1f7 Mon Sep 17 00:00:00 2001 From: albert Date: Thu, 21 Feb 2013 18:26:53 -0500 Subject: [PATCH] add rake task for finding missing ads --- lib/tasks/images.rake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/tasks/images.rake b/lib/tasks/images.rake index 8c70f2f16..647e7c725 100644 --- a/lib/tasks/images.rake +++ b/lib/tasks/images.rake @@ -19,6 +19,15 @@ namespace :images do post.distribute_files end + desc "Finds advertisement images that don't exist" + task :find_missing_ads => :environment do + Advertisement.where("status = 'active'").each do |ad| + if !File.exists?(ad.image_path) + puts ad.image_path + end + end + end + desc "Generate thumbnail-sized images of posts" task :generate_preview => :environment do Post.where("image_width > ?", Danbooru.config.small_image_width).find_each do |post|