-
-
Save linyiru/10807 to your computer and use it in GitHub Desktop.
Attachment_fu: How To Delete The Original File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment