This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This will move all images and other Dragonfly assets from your local server file system to Amazon S3. | |
namespace :dragonfly do | |
task :migrate_to_s3 => :environment do | |
# Adjust this line to meet your needs: | |
{ Product => [:image_uid, :other_uid], Page => :image_uid }.each do |klass, col| | |
puts "Migrating #{klass.table_name}..." | |
Array(col).each do |col| | |
klass.where("#{col} != ''").find_each do |instance| | |
begin |