Skip to content

Instantly share code, notes, and snippets.

@ottbot
Created November 10, 2009 16:35
Show Gist options
  • Save ottbot/231012 to your computer and use it in GitHub Desktop.
Save ottbot/231012 to your computer and use it in GitHub Desktop.
class Story < Sequel::Model
require 'image_science'
attr_accessor :photo_upload
def after_save
super
process_upload!
end
def process_upload!
root = File.dirname(__FILE__).gsub('lib','public/photos/')
path = root << (self.reload.id).to_s
"snip..."
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment