Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy user's avatar from one s3 bucket to anothers user's avatar which should be in another s3 bucket? #2740

Open
ssaha777 opened this issue Apr 29, 2024 · 0 comments

Comments

@ssaha777
Copy link

Hi,
I am trying to copy users and their associated avatar. Avatars must be copied to a different bucket.
What I am trying to do is that

def with_temporary_s3_bucket
      begin
        CarrierWave.configure do |config|
          config.aws_bucket = 'COPY-TO-BUCKET'
        end
        yield
      ensure
        CarrierWave.configure do |config|
          config.aws_bucket = 'COPY-FROM-BUCKET'
        end
      end
    end
file = parent_user.avatar.file

with_temporary_s3_bucket do
  dup_user.avatar = file
end

but this is not uploading any image to 'COPY-TO-BUCKET'

Any help would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant