aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorAli Ibrahim <aibrahim2k2@gmail.com>2019-03-22 10:01:18 -0400
committerAli Ibrahim <aibrahim2k2@gmail.com>2019-03-22 10:01:18 -0400
commit1b7ef40db5ed06b655a624ce56c80fb91b683885 (patch)
tree6a283b7410ab8b0817deb5c99a53529200830c20 /activesupport/lib
parentf40860800c231ecd1daef6cf6b5a8a8eda76478d (diff)
downloadrails-1b7ef40db5ed06b655a624ce56c80fb91b683885.tar.gz
rails-1b7ef40db5ed06b655a624ce56c80fb91b683885.tar.bz2
rails-1b7ef40db5ed06b655a624ce56c80fb91b683885.zip
Update AS::Notifications::Instrumenter#instrument
* Update #instrument to make passing a block optional. This will let users leverage #instrument for messaging in addition to instrumentation.
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/notifications/instrumenter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/notifications/instrumenter.rb b/activesupport/lib/active_support/notifications/instrumenter.rb
index 00a57c38c9..d4e1f3ca6f 100644
--- a/activesupport/lib/active_support/notifications/instrumenter.rb
+++ b/activesupport/lib/active_support/notifications/instrumenter.rb
@@ -20,7 +20,7 @@ module ActiveSupport
# some of the listeners might have state
listeners_state = start name, payload
begin
- yield payload
+ yield payload if block_given?
rescue Exception => e
payload[:exception] = [e.class.name, e.message]
payload[:exception_object] = e