Skip to content

Instantly share code, notes, and snippets.

@jugyo
Created August 20, 2009 07:25
Show Gist options
  • Save jugyo/170890 to your computer and use it in GitHub Desktop.
Save jugyo/170890 to your computer and use it in GitHub Desktop.
# sample to clone attachement_fu object.
class Foo < ActiveRecord::Base
has_attachment :storage => :file_system, :path_prefix => 'assets/foo'
# create clone, but thumbnails are not cloned.
def create_clone
returning clone do |c|
c.temp_paths.unshift create_temp_file
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment