class method
self.build_after_upload
Ruby on Rails 6.0.6
Since v5.2.8.1 Last seen in v6.0.6Available in: v5.2.8.1 v6.0.6
Signature
self.build_after_upload(io:, filename:, content_type: nil, metadata: nil, identify: true)
Returns a new, unsaved blob instance after the io has been uploaded to the service. When providing a content type, pass identify: false to bypass automatic content type inference.
Parameters
-
iokeyreq -
filenamekeyreq -
content_typekey = nil -
metadatakey = nil -
identifykey = true
Source
# File activestorage/app/models/active_storage/blob.rb, line 55
def build_after_upload(io:, filename:, content_type: nil, metadata: nil, identify: true)
new(filename: filename, content_type: content_type, metadata: metadata).tap do |blob|
blob.upload(io, identify: identify)
end
end
Defined in activestorage/app/models/active_storage/blob.rb line 55
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Blob