Flowdock
method

disable

Importance_2
Ruby on Rails latest stable (v4.0.2) - 0 notes - Class: ObserverArray

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.2.13) is shown here.

disable(*observers, &block) public

Disables one or more observers. This supports multiple forms:

ORM.observers.disable :user_observer
  # => disables the UserObserver

User.observers.disable AuditTrail
  # => disables the AuditTrail observer for User notifications.
  #    Other models will still notify the AuditTrail observer.

ORM.observers.disable :observer_1, :observer_2
  # => disables Observer1 and Observer2 for all models.

ORM.observers.disable :all
  # => disables all observers for all models.

User.observers.disable :all do
  # all user observers are disabled for
  # just the duration of the block
end
Show source
Register or log in to add new notes.