class method self.build_after_upload

Ruby on Rails 5.2.8.1

Since v5.2.8.1 Last seen in v6.0.6

Available in: v5.2.8.1 v6.0.6

Signature

self.build_after_upload(io:, filename:, content_type: nil, metadata: nil)

Returns a new, unsaved blob instance after the io has been uploaded to the service.

Parameters

io keyreq
filename keyreq
content_type key = nil
metadata key = nil
Source
# File activestorage/app/models/active_storage/blob.rb, line 51
    def build_after_upload(io:, filename:, content_type: nil, metadata: nil)
      new.tap do |blob|
        blob.filename     = filename
        blob.content_type = content_type
        blob.metadata     = metadata

        blob.upload io
      end
    end

Defined in activestorage/app/models/active_storage/blob.rb line 51 · 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