Guilherme Taschetto

Joined

60 Experience
0 Lessons Completed
0 Questions Solved

Activity

include Rails.application.routes.url_helpers

  def self.exploded_json(object)
    json =object.to_json(:except => [:user_id,:created_at, :updated_at],
                         :include => [
                           :state => {:only => [:id, :name,:code]},
                           :country => {:only => [:id, :name,:code]}
                         ]
    )
    if object.resume.attached?
      json[:resume] = {
        url: rails_blob_url(object.resume)
      }
    end
    return json
  end

I have a Rails 6 app on Heroku with a Postgresql database and ActiveStorage on Amazon S3.

Sometimes I need to sync my local db with production data to make debug easier. And it works great. I want to do the same with ActiveStorage files.

Is there a way to download production files, which is hosted on an Amazon S3 bucket, to my local machine? Preferably an incremental download.

I searched across the web and found nothing about it. :-(

Thank you!

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.