diff options
Diffstat (limited to 'lib/active_storage')
-rw-r--r-- | lib/active_storage/attached.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/active_storage/attached.rb b/lib/active_storage/attached.rb index 7475c38999..d5ded51e2b 100644 --- a/lib/active_storage/attached.rb +++ b/lib/active_storage/attached.rb @@ -4,6 +4,8 @@ require "active_storage/attachment" require "action_dispatch/http/upload" require "active_support/core_ext/module/delegation" +require "global_id/locator" + class ActiveStorage::Attached attr_reader :name, :record @@ -23,6 +25,8 @@ class ActiveStorage::Attached content_type: attachable.content_type when Hash ActiveStorage::Blob.create_after_upload!(attachable) + when String + GlobalID::Locator.locate_signed(attachable) else nil end |