Force File_column to Regenerate the Thumbnails

A small post to show how to let file_column to regenerate the already generated thumbnails.

1
2
3
4
5
def update_attributes(att)
  self.path = File.new(self.path, "r")
  self.save
  super(att)
end

When you put this piece of code in the model where the file_column is used, the only thing that needs to be changed is the ‘path’ variable into the file_column name. The update_attributes method is often used in the update method in the controllers.

Comments

Copyright © 2013 - Tom Pesman - Powered by Octopress