1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Fix ActiveStorage::Preview#download method doc [ci-skip]

Follow-up to #42742.
This commit is contained in:
Jonathan Hefner 2021-07-20 09:32:44 -05:00
parent 990bcac6f8
commit acfadacb07

View file

@ -75,13 +75,11 @@ class ActiveStorage::Preview
end
end
# Downloads the file associated with this preview's variant.
# Raises ActiveStorage::Preview::UnprocessedError if the preview has not been processed yet.
#
# Downloads the file associated with this variant. If no block is given, the
# entire file is read into memory and returned. That'll use a lot of RAM for
# very large files. If a block is given, then the download is streamed and
# yielded in chunks.
# Downloads the file associated with this preview's variant. If no block is
# given, the entire file is read into memory and returned. That'll use a lot
# of RAM for very large files. If a block is given, then the download is
# streamed and yielded in chunks. Raises ActiveStorage::Preview::UnprocessedError
# if the preview has not been processed yet.
def download(&block)
if processed?
variant.download(&block)