I've just added a new thumbnail definition to a class that has
attachments using attachment_fu. Since this thumbnail definition didn't
exist when I uploaded pior images, they don't have this thumbnail. I
have been trying to figure out how to either load the image attachment
and have it build the thumbnail. Does anyone know how to do this?
I ran across this post while looking for a solution to the same
problem. In the end, this worked for me in the attachment model class:
# use attachment_fu protected methods to remake thumbs
def remake_thumbnails!
self.thumbnails.each {|thumb| thumb.destroy}
temp_file = create_temp_file
attachment_options[:thumbnails].each do |suffix, size|
self.create_or_update_thumbnail(temp_file, suffix, *size)
end
end
I use this in a rake task so I can rebuild all thumbnails when needed.