aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/app/models/active_storage/attachment.rb
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2017-08-31 20:10:56 -0400
committerGeorge Claghorn <george@basecamp.com>2017-08-31 20:10:56 -0400
commit2cd8ac1b68ba04ca12a816c8113271017b3c43c4 (patch)
treeba375364a1ba62bd5d07e1757aec578d9992efd7 /activestorage/app/models/active_storage/attachment.rb
parent3c8545bd21cccd44abf6c45b057c1ee34d48a5f4 (diff)
downloadrails-2cd8ac1b68ba04ca12a816c8113271017b3c43c4.tar.gz
rails-2cd8ac1b68ba04ca12a816c8113271017b3c43c4.tar.bz2
rails-2cd8ac1b68ba04ca12a816c8113271017b3c43c4.zip
Have attachments touch their records
Diffstat (limited to 'activestorage/app/models/active_storage/attachment.rb')
-rw-r--r--activestorage/app/models/active_storage/attachment.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activestorage/app/models/active_storage/attachment.rb b/activestorage/app/models/active_storage/attachment.rb
index 2a1c20b7db..29226e8ee9 100644
--- a/activestorage/app/models/active_storage/attachment.rb
+++ b/activestorage/app/models/active_storage/attachment.rb
@@ -9,7 +9,7 @@ require "active_support/core_ext/module/delegation"
class ActiveStorage::Attachment < ActiveRecord::Base
self.table_name = "active_storage_attachments"
- belongs_to :record, polymorphic: true
+ belongs_to :record, polymorphic: true, touch: true
belongs_to :blob, class_name: "ActiveStorage::Blob"
delegate_missing_to :blob