diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/active_storage/attachment.rb | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/app/models/active_storage/attachment.rb b/app/models/active_storage/attachment.rb index 20c619aa5a..1dd202ca45 100644 --- a/app/models/active_storage/attachment.rb +++ b/app/models/active_storage/attachment.rb @@ -6,19 +6,11 @@ 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 :blob, class_name: "ActiveStorage::Blob" delegate_missing_to :blob - def record - @record ||= GlobalID::Locator.locate(record_gid) - end - - def record=(record) - @record = record - self.record_gid = record&.to_gid - end - def purge blob.purge destroy |