module ActiveStorage::Downloading

def download_blob_to_tempfile #:doc:

:doc:
Opens a new tempfile in #tempdir and copies blob data into it. Yields the tempfile.
def download_blob_to_tempfile #:doc:
  open_tempfile_for_blob do |file|
    download_blob_to file
    yield file
  end
end