Skip to content
Permalink
Browse files

created maintenance rake task to refresh photos when new sizes are ne…

…eded
  • Loading branch information...
bitwelder committed Dec 27, 2010
1 parent c1d08e7 commit 94eeb5c87dfb120abdffe5589698db4ca030afae
Showing with 21 additions and 0 deletions.
  1. +21 −0 lib/tasks/maintenance.rake
@@ -0,0 +1,21 @@
namespace :maintenance do
desc "Recreates image files if new formats are specified via paperc"
task :recreate_image_files => :environment do
puts "Recreating image files..."

Organization.all.each do |organization|
organization.organization_photos.each do |photo|
puts "Reprocessing organization photo:#{photo.id}"
photo.file.reprocess!
end
end

Project.all.each do |project|
project.project_photos.each do |photo|
puts "Reprocessing project photo:#{photo.id}"
photo.file.reprocess!
end
end
puts "done"
end
end

0 comments on commit 94eeb5c

Please sign in to comment.
You can’t perform that action at this time.