kbingman / paperclipped

Please note, this extension is no longer being developed. Please take a look at the radiant-clipped-extension instead. Radiant extension for managing assets and images with the Paperclip plugin.
Other
122 stars 64 forks source link

Regenerate Thumbnails Fix in 0.9.1 Radiant and latest Paperclipped [FIXED] #42

Open pjammer opened 12 years ago

pjammer commented 12 years ago

This is google bait, but the Regenerate Thumbnails button on any page, wasn't working for me. What fixed it was changing these lines of code in the lib/tasks/paperclip_tasks.rake file

def for_all_attachments
obtain_class
names = obtain_attachments
ids   = @klass.connection.select_values(@klass.send(:construct_finder_sql, :select  => 'id'))

ids.each do |id|
    instance = @klass.find(id)
    names.each do |name|
      result = if instance.send("#{ name }?")
                 yield(instance, name)
               else
                 true
               end
      print result ? "." : "x"; $stdout.flush
    end
  end
  puts " Done."
end

Will submit patch later, but it looks like it has never worked? Now it may not be fair, because when you dance with a heisenbug like I had, you change a lot of stuff, but it was this last change that worked for me. Hope it helps.