The example in the README should be a little different for Rails 6.
Active Storage Full copy example code:
pirate.deep_clone include: :parrot do |original, kopy|
if kopy.is_a?(Pirate) && original.avatar.attached?
original.avatar.open do |tempfile|
kopy.avatar.attach({
io: File.open(tempfile.path),
filename: original.avatar.blob.filename,
content_type: original.avatar.blob.content_type
})
end
end
end
The example in the README should be a little different for Rails 6. Active Storage Full copy example code: