aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/app
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-05-17 19:14:11 -0400
committerGeorge Claghorn <george@basecamp.com>2018-05-17 19:14:11 -0400
commit9f95767979579f5761cb0d2bcccb67f3662349c5 (patch)
tree9375eeeeff7d494e2dcf0b206e89ea892cb21f4a /activestorage/app
parentf018d4e118f34fd9b54ad45771ed575936678158 (diff)
downloadrails-9f95767979579f5761cb0d2bcccb67f3662349c5.tar.gz
rails-9f95767979579f5761cb0d2bcccb67f3662349c5.tar.bz2
rails-9f95767979579f5761cb0d2bcccb67f3662349c5.zip
Permit opening a blob in a custom tempdir
Diffstat (limited to 'activestorage/app')
-rw-r--r--activestorage/app/models/active_storage/blob.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activestorage/app/models/active_storage/blob.rb b/activestorage/app/models/active_storage/blob.rb
index 9bf0766843..134d3bb2d9 100644
--- a/activestorage/app/models/active_storage/blob.rb
+++ b/activestorage/app/models/active_storage/blob.rb
@@ -167,8 +167,8 @@ class ActiveStorage::Blob < ActiveRecord::Base
end
# Downloads the blob to a tempfile on disk. Yields the tempfile.
- def open(&block)
- ActiveStorage::Downloader.new(self).download_blob_to_tempfile(&block)
+ def open(tempdir: nil, &block)
+ ActiveStorage::Downloader.new(self, tempdir: tempdir).download_blob_to_tempfile(&block)
end