class method
self.create_after_upload!
Ruby on Rails 5.2.8.1
Since v5.2.8.1 Last seen in v6.1.7.10Signature
self.create_after_upload!(io:, filename:, content_type: nil, metadata: nil)
Returns a saved blob instance after the io has been uploaded to the service. Note, the blob is first built, then the io is uploaded, then the blob is saved. This is done this way to avoid uploading (which may take time), while having an open database transaction.
Parameters
-
iokeyreq -
filenamekeyreq -
content_typekey = nil -
metadatakey = nil
Source
# File activestorage/app/models/active_storage/blob.rb, line 64
def create_after_upload!(io:, filename:, content_type: nil, metadata: nil)
build_after_upload(io: io, filename: filename, content_type: content_type, metadata: metadata).tap(&:save!)
end
Defined in activestorage/app/models/active_storage/blob.rb line 64
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Blob