[ActiveStorage] Same file attached multiple times; single Blob or multiple Blobs?

Thank you for your response Dino, but I still feel like I’m missing something because the last sentence of your Blob explanation confuses me.

Because of this, you have 2 different Blobs in your test case

If this is the same file attached twice on two different User model instances I’d expect:

  • a single ActiveStorage::Blob to represent this single file
  • two ActiveStorage::Attachment entries to associate this single blob to the two different Users. If we create any variants then another blob is created for the variant but to get two blobs right from the start feels to me like a bug. Shouldn’t checksums be unique within the active_storage_blobs table in order to maintain the “One file, one blob”? I apologize if I’m missing something incredibly obvious here and I appreciate your patience with me :slight_smile:

Thanks again!

-Dan