Flowdock
method

disable

Importance_2
v3.1.0 - Show latest stable - 0 notes - Class: ObserverArray
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.