Commit 0df5a960 by Joost Baaij Committed by Jon Yurek

Added comments and add explicit ordering to this method, which makes the result…

Added comments and add explicit ordering to this method, which makes the result deterministic and resumeable should an error occur mid-way. 
parent 72430159
......@@ -138,8 +138,10 @@ module Paperclip
@known_processors[name.to_s] = processor
end
# Find all instances of the given Active Record model +klass+ with attachment +name+.
# This method is used by the refresh rake tasks.
def each_instance_with_attachment(klass, name)
class_for(klass).all.each do |instance|
class_for(klass).find(:all, :order => 'id').each do |instance|
yield(instance) if instance.send(:"#{name}?")
end
end
......
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