class
ActiveStorage::VariantWithRecordProcessedTest::CountingService
- ActiveStorage::VariantWithRecordProcessedTest::CountingService
- ActiveStorage::Service::DiskService
- ActiveStorage::Service
- Reference
- Object
Overview
Counts the uploads, and runs #on_upload after each one.
The upload of the variant image sits between the transform and the record insert, so the hook is the seam the race tests need: it is the one point where another request's row can land. :nodoc:
Defined in:
active_storage/variant_with_record_test.crInstance Method Summary
- #on_upload : Proc(Nil) | Nil
- #on_upload=(on_upload : Proc(Nil) | Nil)
-
#upload(key : String, io : IO, checksum : String | Nil = nil, filename : ActiveStorage::Filename | Nil = nil, content_type : String | Nil = nil, disposition : String | Nil = nil) : Nil
Stores the content of the passed IO under the passed key.
- #uploads : Int32
Instance methods inherited from class ActiveStorage::Service::DiskService
delete(key : String) : Nil
delete,
delete_prefixed(prefix : String) : Nil
delete_prefixed,
download(key : String, & : Bytes -> ) : Nildownload(key : String) : String download, download_chunk(key : String, range : Range(Int64, Int64)) : String download_chunk, exist?(key : String) : Bool exist?, name : String name, path_for(key : String) : String path_for, private_url(key : String, expires_in : Time::Span, filename : ActiveStorage::Filename, disposition : String, content_type : String) private_url, public_url(key : String, filename : ActiveStorage::Filename, content_type : String, disposition : String) public_url, root : String root, upload(key : String, io : IO, checksum : String | Nil = nil, filename : ActiveStorage::Filename | Nil = nil, content_type : String | Nil = nil, disposition : String | Nil = nil) : Nil upload
Constructor methods inherited from class ActiveStorage::Service::DiskService
new(root : String, public : Bool = false)
new
Instance methods inherited from class ActiveStorage::Service
content_disposition_with(filename : Filename, type : String | Nil = "inline") : String
content_disposition_with,
delete(key : String) : Nil
delete,
delete_prefixed(prefix : String) : Nil
delete_prefixed,
download(key : String) : Stringdownload(key : String, & : Bytes -> ) : Nil download, download_chunk(key : String, range : Range(Int64, Int64)) : String download_chunk, exist?(key : String) : Bool exist?, private_url(key : String, expires_in : Time::Span, filename : Filename, disposition : String, content_type : String) private_url, public? : Bool public?, public_url(key : String, filename : Filename, content_type : String, disposition : String) public_url, upload(key : String, io : IO, checksum : String | Nil = nil, filename : Filename | Nil = nil, content_type : String | Nil = nil, disposition : String | Nil = nil) : Nil upload, url(key : String, expires_in : Time::Span, filename : Filename, content_type : String, disposition : String) url
Constructor methods inherited from class ActiveStorage::Service
new
new
Instance Method Detail
Stores the content of the passed IO under the passed key.
The content is written to a temporary file next to its final path and renamed once it is
complete, so a reader never sees a partially written object. filename, content_type and
disposition are accepted for the ActiveStorage::Service contract and ignored: a disk object
carries no metadata, the serving headers are rebuilt from the signed key instead.
https://github.com/rails/rails/blob/v8.1.3/activestorage/lib/active_storage/service/disk_service.rb