Skip to content

Instantly share code, notes, and snippets.

@pgeraghty
Last active August 29, 2015 13:57
Show Gist options
  • Save pgeraghty/9600721 to your computer and use it in GitHub Desktop.
Save pgeraghty/9600721 to your computer and use it in GitHub Desktop.
Migrate Carrierwave local images to S3
Image.where.not(photo: nil).each do |image|
image_path = URI.parse(image.photo_url).path
image.update_attribute("remote_photo_url", "http://localhost:3000#{image_path}")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment