Commit d2ad7f06 by Jon Yurek

Added some logging for the reprocessing task.

parent 10968ea3
...@@ -174,6 +174,10 @@ module Paperclip ...@@ -174,6 +174,10 @@ module Paperclip
post_process post_process
old_original.close if old_original.respond_to?(:close) old_original.close if old_original.respond_to?(:close)
@errors.empty?
else
true
end end
end end
......
...@@ -40,9 +40,13 @@ namespace :paperclip do ...@@ -40,9 +40,13 @@ namespace :paperclip do
namespace :refresh do namespace :refresh do
desc "Regenerates thumbnails for a given CLASS (and optional ATTACHMENT)." desc "Regenerates thumbnails for a given CLASS (and optional ATTACHMENT)."
task :thumbnails => :environment do task :thumbnails => :environment do
errors = []
for_all_attachments do |instance, name| for_all_attachments do |instance, name|
instance.send(name).reprocess! result = instance.send(name).reprocess!
errors << [instance.id, instance.errors] unless instance.errors.blank?
result
end end
errors.each{|e| puts "#{e.first}: #{e.last.full_messages.inspect}" }
end end
desc "Regenerates content_type/size metadata for a given CLASS (and optional ATTACHMENT)." desc "Regenerates content_type/size metadata for a given CLASS (and optional ATTACHMENT)."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment