Permalink
Browse files

tap the subscriber for easier return value

  • Loading branch information...
tenderlove committed Jul 18, 2010
1 parent 2cbef69 commit 234b9699463ba435086aa253ee143014a835bbe6
Showing with 3 additions and 2 deletions.
  1. +3 −2 activesupport/lib/active_support/notifications/fanout.rb
@@ -10,8 +10,9 @@ def initialize
def subscribe(pattern = nil, &block)
@listeners_for.clear
- @subscribers << Subscriber.new(pattern, &block)
- @subscribers.last
+ Subscriber.new(pattern, &block).tap do |s|
+ @subscribers << s
+ end
end
def unsubscribe(subscriber)

0 comments on commit 234b969

Please sign in to comment.