Skip to content

Instantly share code, notes, and snippets.

View PaulRHanson316's full-sized avatar

Paul Hanson PaulRHanson316

View GitHub Profile
@airblade
airblade / copy_attachments.rb
Created November 10, 2015 11:01
Copies S3-stored Paperclip attachments from one AR model to another
# lib/paperclip/copy_attachments.rb
# Copies S3-stored Paperclip attachments from one AR model to another.
#
# This module should be mixed into the target AR model.
if Gem::Version.new(::AWS::VERSION) >= Gem::Version.new(2)
raise NotImplementedError, 'coded for aws-sdk v1'
end