instance method
create_blob_from
Ruby on Rails 5.2.8.1
Since v5.2.8.1 Last seen in v5.2.8.1 PrivateSignature
create_blob_from(attachable)
No documentation comment.
Parameters
-
attachablereq
Source
# File activestorage/lib/active_storage/attached.rb, line 18
def create_blob_from(attachable)
case attachable
when ActiveStorage::Blob
attachable
when ActionDispatch::Http::UploadedFile, Rack::Test::UploadedFile
ActiveStorage::Blob.create_after_upload! \
io: attachable.open,
filename: attachable.original_filename,
content_type: attachable.content_type
when Hash
ActiveStorage::Blob.create_after_upload!(attachable)
when String
ActiveStorage::Blob.find_signed(attachable)
else
nil
end
end
Defined in activestorage/lib/active_storage/attached.rb line 18
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Attached