Skip to content

Instantly share code, notes, and snippets.

@ashchan
Created August 26, 2008 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ashchan/7251 to your computer and use it in GitHub Desktop.
Save ashchan/7251 to your computer and use it in GitHub Desktop.
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