class method self.detach_from

Ruby on Rails 8.1.2

Since v6.0.6

Available in: v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

self.detach_from(namespace, notifier = ActiveSupport::Notifications)

Detach the subscriber from a namespace.

Parameters

namespace req
notifier opt = ActiveSupport::Notifications
Source
# File activesupport/lib/active_support/subscriber.rb, line 50
      def detach_from(namespace, notifier = ActiveSupport::Notifications)
        @namespace  = namespace
        @subscriber = find_attached_subscriber
        @notifier   = notifier

        return unless subscriber

        subscribers.delete(subscriber)

        # Remove event subscribers of all existing methods on the class.
        fetch_public_methods(subscriber, true).each do |event|
          remove_event_subscriber(event)
        end

        # Reset notifier so that event subscribers will not add for new methods added to the class.
        @notifier = nil
      end

Defined in activesupport/lib/active_support/subscriber.rb line 50 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::Subscriber

Type at least 2 characters to search.

↑↓ navigate · open · esc close