aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/notifications
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2013-05-17 16:27:23 -0700
committerCarl Lerche <me@carllerche.com>2013-05-17 16:27:23 -0700
commite539228d088c4e9de5bbc24bd82fb2d894d8c158 (patch)
treecc7748f0828e559882f281250365128357895cc1 /activesupport/lib/active_support/notifications
parent18fe96cc168927a6508478f9ad127d57c1ad56dd (diff)
downloadrails-e539228d088c4e9de5bbc24bd82fb2d894d8c158.tar.gz
rails-e539228d088c4e9de5bbc24bd82fb2d894d8c158.tar.bz2
rails-e539228d088c4e9de5bbc24bd82fb2d894d8c158.zip
Bug fix: Evented notification subscribers can handle published events
Diffstat (limited to 'activesupport/lib/active_support/notifications')
-rw-r--r--activesupport/lib/active_support/notifications/fanout.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/notifications/fanout.rb b/activesupport/lib/active_support/notifications/fanout.rb
index 7588fdb67c..99fe03e6d0 100644
--- a/activesupport/lib/active_support/notifications/fanout.rb
+++ b/activesupport/lib/active_support/notifications/fanout.rb
@@ -79,6 +79,13 @@ module ActiveSupport
def initialize(pattern, delegate)
@pattern = pattern
@delegate = delegate
+ @can_publish = delegate.respond_to?(:publish)
+ end
+
+ def publish(name, *args)
+ if @can_publish
+ @delegate.publish name, *args
+ end
end
def start(name, id, payload)