diff options
author | Robin Dupret <robin.dupret@gmail.com> | 2018-10-24 15:35:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-24 15:35:30 +0200 |
commit | 46c2a8657969075a55209301cd63cf3b285cd0c4 (patch) | |
tree | 400a3e56fd2a8e070ad96ba4d717cee64bf67711 /activestorage | |
parent | 3081a54ee39ebc837799eb2d35d879a8de248926 (diff) | |
parent | 79e086efc4532cee9216358611e28a83eafb2a11 (diff) | |
download | rails-46c2a8657969075a55209301cd63cf3b285cd0c4.tar.gz rails-46c2a8657969075a55209301cd63cf3b285cd0c4.tar.bz2 rails-46c2a8657969075a55209301cd63cf3b285cd0c4.zip |
Merge pull request #34302 from kylekeesling/activestorage-attachment-model-docs
Update ActiveStorage Attachment model documentation [ci skip]
Diffstat (limited to 'activestorage')
-rw-r--r-- | activestorage/app/models/active_storage/attachment.rb | 5 |
1 files 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 <tt>has_one/many_attached :thingy, dependent: false</tt>, 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" |