class method self.detach_from

Ruby on Rails 6.0.6.1

Since v6.0.6.1

Available in: v6.0.6.1 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3.2 v8.0.5.1 v8.1.3.1 edge

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 48
      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.
        subscriber.public_methods(false).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 48 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::Subscriber

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close