aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activestorage/lib/active_storage/previewer.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/activestorage/lib/active_storage/previewer.rb b/activestorage/lib/active_storage/previewer.rb
index 7db9ae5956..dacab1e7df 100644
--- a/activestorage/lib/active_storage/previewer.rb
+++ b/activestorage/lib/active_storage/previewer.rb
@@ -43,9 +43,11 @@ module ActiveStorage
#
# The output tempfile is opened in the directory returned by ActiveStorage::Downloading#tempdir.
def draw(*argv) #:doc:
- Tempfile.open("ActiveStorage", tempdir) do |file|
- capture(*argv, to: file)
- yield file
+ ActiveSupport::Notifications.instrument("preview.active_storage") do
+ Tempfile.open("ActiveStorage", tempdir) do |file|
+ capture(*argv, to: file)
+ yield file
+ end
end
end