Skip to content

Instantly share code, notes, and snippets.

View fidalgo's full-sized avatar
🐧

Paulo Fidalgo fidalgo

🐧
View GitHub Profile
@fidalgo
fidalgo / copy_attachments.rb
Created March 31, 2021 10:25 — forked from airblade/copy_attachments.rb
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