From 79e086efc4532cee9216358611e28a83eafb2a11 Mon Sep 17 00:00:00 2001 From: Kyle Keesling Date: Tue, 23 Oct 2018 21:25:15 -0400 Subject: update activestorage attachment model documentation reflect recent behavior changes --- activestorage/app/models/active_storage/attachment.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/activestorage/app/models/active_storage/attachment.rb b/activestorage/app/models/active_storage/attachment.rb index 4bdd1c0224..13758d9179 100644 --- a/activestorage/app/models/active_storage/attachment.rb +++ b/activestorage/app/models/active_storage/attachment.rb @@ -3,9 +3,8 @@ require "active_support/core_ext/module/delegation" # Attachments associate records with blobs. Usually that's a one record-many blobs relationship, -# but it is possible to associate many different records with the same blob. If you're doing that, -# you'll want to declare with has_one/many_attached :thingy, dependent: false, so that destroying -# any one record won't destroy the blob as well. (Then you'll need to do your own garbage collecting, though). +# but it is possible to associate many different records with the same blob. A foreign-key constraint +# on the attachments table prevents blobs from being purged if they’re still attached to any records. class ActiveStorage::Attachment < ActiveRecord::Base self.table_name = "active_storage_attachments" -- cgit v1.2.3