aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib/active_storage/previewer.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activestorage/lib/active_storage/previewer.rb')
-rw-r--r--activestorage/lib/active_storage/previewer.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activestorage/lib/active_storage/previewer.rb b/activestorage/lib/active_storage/previewer.rb
index 460f6d5678..ed75bae3b5 100644
--- a/activestorage/lib/active_storage/previewer.rb
+++ b/activestorage/lib/active_storage/previewer.rb
@@ -40,8 +40,10 @@ module ActiveStorage
# end
# end
# end
+ #
+ # The output tempfile is opened in the directory returned by ActiveStorage::Downloading#tempdir.
def draw(*argv) # :doc:
- Tempfile.open("ActiveStorage") do |file|
+ Tempfile.open("ActiveStorage", tempdir) do |file|
capture(*argv, to: file)
yield file
end