Skip to content

Commit

Permalink
Fix ActiveStorage::Preview#download method doc [ci-skip]
Browse files Browse the repository at this point in the history
Follow-up to #42742.
  • Loading branch information
jonathanhefner committed Jul 20, 2021
1 parent 990bcac commit acfadac
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions activestorage/app/models/active_storage/preview.rb
Expand Up @@ -75,13 +75,11 @@ def key
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)
Expand Down

0 comments on commit acfadac

Please sign in to comment.