You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
take an object which has a file in s3 and call
offer.offer_pdf.present?
expected result : true, actual_result: true
delete that file from the s3 bucket and call the same method again
offer.offer_pdf.present?
expected result: false, actual_result: true
I suspect the result of the "#present?" is cached and the actual state is not reflected when calling it again. Is there any way to clear this cache so I can get the current status of the file?
(I tried calling #reload on the offer object, but still it did not reflect the actual status of the file)
I raised the same question under fog repo, they feel there should be a way to achieve this using CarrierWave (fog/fog#4029)
The text was updated successfully, but these errors were encountered:
tl;dr: When you call offer.offer_url.present? you are not checking whether the actual remote file is available, but merely whether carrierwave was able to generate a URL for the location where the file should be.
Environment details
ruby 2.6.2
rails 5.1
carrierwave 2.0
carrierwave-mongoid 1.3
Steps to reproduce
take an object which has a file in s3 and call
offer.offer_pdf.present?
expected result : true, actual_result: true
delete that file from the s3 bucket and call the same method again
offer.offer_pdf.present?
expected result: false, actual_result: true
I suspect the result of the "#present?" is cached and the actual state is not reflected when calling it again. Is there any way to clear this cache so I can get the current status of the file?
(I tried calling #reload on the offer object, but still it did not reflect the actual status of the file)
I raised the same question under fog repo, they feel there should be a way to achieve this using CarrierWave (fog/fog#4029)
The text was updated successfully, but these errors were encountered: