diff options
author | George Claghorn <george@basecamp.com> | 2018-05-30 20:01:07 -0400 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-05-30 20:05:39 -0400 |
commit | a6d80e164f2f5566472370a84ab7cd98736666c4 (patch) | |
tree | bde6f7b857255fd12d81702d23debd7b995876c2 /activestorage/lib | |
parent | e2e053608ed71d22d7f3e22af605ab284ef00f05 (diff) | |
download | rails-a6d80e164f2f5566472370a84ab7cd98736666c4.tar.gz rails-a6d80e164f2f5566472370a84ab7cd98736666c4.tar.bz2 rails-a6d80e164f2f5566472370a84ab7cd98736666c4.zip |
Include blob ID in tempfile name for debugging convenience
Diffstat (limited to 'activestorage/lib')
-rw-r--r-- | activestorage/lib/active_storage/downloader.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/activestorage/lib/active_storage/downloader.rb b/activestorage/lib/active_storage/downloader.rb index 2aa56a729a..87be6efb05 100644 --- a/activestorage/lib/active_storage/downloader.rb +++ b/activestorage/lib/active_storage/downloader.rb @@ -19,7 +19,7 @@ module ActiveStorage attr_reader :blob, :tempdir def open_tempfile - file = Tempfile.open([ "ActiveStorage", tempfile_extension_with_delimiter ], tempdir) + file = Tempfile.open([ "ActiveStorage-#{blob.id}-", blob.filename.extension_with_delimiter ], tempdir) begin yield file @@ -40,9 +40,5 @@ module ActiveStorage raise ActiveStorage::IntegrityError end end - - def tempfile_extension_with_delimiter - blob.filename.extension_with_delimiter - end end end |