Flowdock
method

enable

Importance_2
v3.2.3 - Show latest stable - 0 notes - Class: ObserverArray
enable(*observers, &block) public

Enables one or more observers. This supports multiple forms:

ORM.observers.enable :user_observer
  # => enables the UserObserver

User.observers.enable AuditTrail
  # => enables the AuditTrail observer for User notifications.
  #    Other models will not be affected (i.e. they will not
  #    trigger notifications to AuditTrail if previously disabled)

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

ORM.observers.enable :all
  # => enables all observers for all models.

User.observers.enable :all do
  # all user observers are enabled for
  # just the duration of the block
end

Note: all observers are enabled by default. This method is only useful when you have previously disabled one or more observers.

Show source
Register or log in to add new notes.