deduce (owner)

Fork Of

Revisions

gist: 10807 Download_button fork
public
Description:
Attachment_fu: How To Delete The Original File
Public Clone URL: git://gist.github.com/10807.git
Embed All Files: show embed
Attachment_fu: How To Delete The Original File #
1
2
3
4
5
6
7
8
9
10
class Photo < ActiveRecord::Base
 
  has_attachment options_for_attachment_fu
  
  after_attachment_saved do |foto|
    # delete original file for disk space saving
    FileUtils.rm foto.full_filename if foto.parent.nil?
  end
 
end