Skip to content

add `file_exist?` method for ActiveStorage::Blob, ActiveStorage::Variant, ActiveStorage::VariantWithRecord

Created by: cprodhomme

It's help to check if all it's ok on the service storage

Motivation / Background

This Pull Request has been created because we (@captive-studio) handle a large number of files using ActiveStorage in our application where these files are central to the business.

For some time now, we have noticed that certain variants are not being properly saved in the storage (specifically Google Cloud Storage). We want to rectify this situation by retrieving the variants for which the file does not exist in the storage.

Detail

This Pull Request changes add new file_exist? method for ActiveStorage::Blob, ActiveStorage::Variant, ActiveStorage::VariantWithRecord

This method will help to check if a file exist on the storage service

Additional information

/

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Unrelated changes should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Merge request reports