class Image < ActiveRecord::Base
#you attachment fu config
def clone cloned = super cloned.filename = "#{rand(1000)}_#{self.filename}" cloned.temp_data = File.read( self.full_filename ) cloned end
end
#code
cloned_image = some_image.clone cloned_image.save! #saving the image will also create the thumbnails