From aaf89cdea7105ae7789483cec2d786cfa1cef7f9 Mon Sep 17 00:00:00 2001 From: Ali Ibrahim Date: Fri, 22 Mar 2019 11:17:33 -0400 Subject: Update CHANGELOG and docs with change to ActiveSupport::Notifications::Instrumenter#instrument --- activesupport/CHANGELOG.md | 7 +++++++ activesupport/lib/active_support/notifications/instrumenter.rb | 7 ++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index 63e2e44597..3d63420efd 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,3 +1,10 @@ +* Update `ActiveSupport::Notifications::Instrumenter#instrument to make + passing a block optional. This will let users use + `ActiveSupport::Notifications` messaging features outside of + instrumentation. + + *Ali Ibrahim* + * Fix `Time#advance` to work with dates before 1001-03-07 Before: diff --git a/activesupport/lib/active_support/notifications/instrumenter.rb b/activesupport/lib/active_support/notifications/instrumenter.rb index d4e1f3ca6f..a03e7e483e 100644 --- a/activesupport/lib/active_support/notifications/instrumenter.rb +++ b/activesupport/lib/active_support/notifications/instrumenter.rb @@ -13,9 +13,10 @@ module ActiveSupport @notifier = notifier end - # Instrument the given block by measuring the time taken to execute it - # and publish it. Notice that events get sent even if an error occurs - # in the passed-in block. + # Given a block, instrument it by measuring the time taken to execute + # and publish it. Without a block, simply send a message via the + # notifier. Notice that events get sent even if an error occurs in the + # passed-in block. def instrument(name, payload = {}) # some of the listeners might have state listeners_state = start name, payload -- cgit v1.2.3