diff options
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/notifications/fanout.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/activesupport/lib/active_support/notifications/fanout.rb b/activesupport/lib/active_support/notifications/fanout.rb index 300ec842a9..b27713e4ad 100644 --- a/activesupport/lib/active_support/notifications/fanout.rb +++ b/activesupport/lib/active_support/notifications/fanout.rb @@ -39,13 +39,7 @@ module ActiveSupport class Binding #:nodoc: def initialize(queue, pattern) @queue = queue - @pattern = - case pattern - when Regexp, NilClass - pattern - else - /^#{Regexp.escape(pattern.to_s)}$/ - end + @pattern = pattern end def subscribe(&block) @@ -70,13 +64,13 @@ module ActiveSupport end def subscribed_to?(name) - !@pattern || @pattern =~ name.to_s + !@pattern || @pattern === name.to_s end def matches?(subscriber_or_name) case subscriber_or_name when String - @pattern && @pattern =~ subscriber_or_name + @pattern && @pattern === subscriber_or_name when self true end |