Option to prevent duplicate uploads in ActiveStorage

Use case: I may the same scan as a reference for a many records and don’t want to upload multiple copies.

Would have to be optional and deletions would be more difficult. I can’t say as I understand AS very well.

thank you for listening.

OP correcting errors. Sorry. Updated below, ignore original

Use case: I may use the same scan as a reference for many records and don’t want to have multiple copies. In other words when I create a record I am using the information on the scan and want to show that scan with the record.

Would have to be optional and deletions would be more difficult. I can’t say as I understand AS very well.

Or would it be better to check for duplicate after uploading, change active_records_attachment to point to the blob_id that was added first and then delete the just uploaded duplicate?

thank you for listening.