aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/notifications
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-06-03 05:47:10 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-06-03 05:47:10 +0900
commit90d6237762da832d0c6302b31fd68d3efb771c64 (patch)
tree8147e46c31395e9a0db3cb60ef38dcc34ad50119 /activesupport/lib/active_support/notifications
parentc3ca9b00e3c5f839311c55549f25f7afe8120f9d (diff)
downloadrails-90d6237762da832d0c6302b31fd68d3efb771c64.tar.gz
rails-90d6237762da832d0c6302b31fd68d3efb771c64.tar.bz2
rails-90d6237762da832d0c6302b31fd68d3efb771c64.zip
Fix `subscribed` with no pattern to subscribe all messages
This is a regression for #36184. And also, add new `monotonic` argument to the last of the method signature rather than the first.
Diffstat (limited to 'activesupport/lib/active_support/notifications')
-rw-r--r--activesupport/lib/active_support/notifications/fanout.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/notifications/fanout.rb b/activesupport/lib/active_support/notifications/fanout.rb
index c37bec4ee5..aa602329ec 100644
--- a/activesupport/lib/active_support/notifications/fanout.rb
+++ b/activesupport/lib/active_support/notifications/fanout.rb
@@ -20,8 +20,8 @@ module ActiveSupport
super
end
- def subscribe(pattern = nil, callable = nil, monotonic = false, &block)
- subscriber = Subscribers.new(monotonic, pattern, callable || block)
+ def subscribe(pattern = nil, callable = nil, monotonic: false, &block)
+ subscriber = Subscribers.new(pattern, callable || block, monotonic)
synchronize do
if String === pattern
@string_subscribers[pattern] << subscriber
@@ -84,7 +84,7 @@ module ActiveSupport
end
module Subscribers # :nodoc:
- def self.new(monotonic, pattern, listener)
+ def self.new(pattern, listener, monotonic)
subscriber_class = monotonic ? MonotonicTimed : Timed
if listener.respond_to?(:start) && listener.respond_to?(:finish)