Brain Burn

Joined

550 Experience
5 Lessons Completed
0 Questions Solved

Activity

Posted in Direct File Uploads to S3: Part 3 Discussion

@excid3:disqus

Removing this line from config/initializers/shrine.rb, fixes the issue, allowing my tests to run.

if !Rails.env.test?

I assume the tutorial included that if statement to prevent file uploads during tests, but it prevents all tests from running.

Do you see any downside to removing the if statement?

Posted in Direct File Uploads to S3: Part 3 Discussion

Oh, and I I restarted spring just in case, but that had no effect.

Posted in Direct File Uploads to S3: Part 3 Discussion

@excid3:disqus @jankomarohnic:disqus I have everything working beautifully here, but when I run my tests I get: uninitialized constant ImageUploader::UploadEndpoint (NameError)

I found this discussion recommending putting the uploader class in the app/uploaders directory, but am still getting the same error.

https://groups.google.com/f...

Any ideas? Thank you so much for your help.

Posted in Direct File Uploads to S3: Part 3 Discussion

Hi @fakefarm:disqus. I had the same question. I found a discussion here: https://github.com/janko-m/... that suggests two options.

1. Use a Shrine plugin called 'moving' to delete the cached S3 file immediately after it is moved to the store bucket.
http://shrinerb.com/rdoc/cl...
I think you would include this line 'Shrine.plugin :moving, storages: [:store]' in 'config/initializers/shrine.rb'

2. Amazon can be set up to delete files in the cache bucket periodically, documentation here: http://docs.aws.amazon.com/...

@excid3:disqus, My question is... Why does Shrine upload to a 'cache' bucket first and then copy it to a 'store' bucket? I haven't been able to find an answer online yet. If you could explain why Shrine or S3 works this way or post a link it would be greatly appreciated!

Posted in Direct File Uploads to S3: Part 3 Discussion

Chris! Just wanted to say that this series is beautifully done. Thank you so much for your hard work and attention to detail. I love how you explain how everything works the hard way or even the wrong way first which helps us understand how the final implementation decisions were made. It took me two full days to get through it all, but everything is working for me. Excellent. Awesome! Thanks again.

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.