method

upload

Importance_0
v7.1.3.4 - Show latest stable - 0 notes - Class: CreateOne
upload() public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activestorage/lib/active_storage/attached/changes/create_one.rb, line 23
    def upload
      case attachable
      when ActionDispatch::Http::UploadedFile
        blob.upload_without_unfurling(attachable.open)
      when Rack::Test::UploadedFile
        blob.upload_without_unfurling(
          attachable.respond_to?(:open) ? attachable.open : attachable
        )
      when Hash
        blob.upload_without_unfurling(attachable.fetch(:io))
      when File
        blob.upload_without_unfurling(attachable)
      when Pathname
        blob.upload_without_unfurling(attachable.open)
      when ActiveStorage::Blob
      when String
      else
        raise(
          ArgumentError,
          "Could not upload: expected attachable, "              "got #{attachable.inspect}"
        )
      end
    end
Register or log in to add new notes.