From e539228d088c4e9de5bbc24bd82fb2d894d8c158 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 17 May 2013 16:27:23 -0700 Subject: Bug fix: Evented notification subscribers can handle published events --- activesupport/lib/active_support/notifications/fanout.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'activesupport/lib') 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) -- cgit v1.2.3