class method self.create_after_upload!

Ruby on Rails 5.2.8.1

Since v5.2.8.1 Last seen in v6.1.7.10

Available in: v5.2.8.1 v6.0.6 v6.1.7.10

Signature

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

io keyreq
filename keyreq
content_type key = nil
metadata key = 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

Type at least 2 characters to search.

↑↓ navigate · open · esc close