1
0
mirror of https://github.com/danbee/my-images synced 2025-03-04 08:49:05 +00:00
my-images/lib/tasks/images_migrate.rake
Dan Barber 5b2d1d4d17
Migrate images to Active Storage
Also adds a rake task to do the migration.
2018-11-16 17:16:01 -05:00

12 lines
257 B
Ruby

namespace :images do
desc "Migrate all the images to Active Storage"
task migrate: :environment do
Image.all.each do |image|
image.image.attach(
io: image.df_image.file,
filename: image.df_image.name,
)
end
end
end