method
observers=
v3.2.1 -
Show latest stable
-
0 notes -
Class: ActiveModel::Observing::ClassMethods
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3 (0)
- 2.1.0 (0)
- 2.2.1 (0)
- 2.3.8 (0)
- 3.0.0 (38)
- 3.0.9 (-2)
- 3.1.0 (1)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2
- 4.1.8
- 4.2.1
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
observers=(*values)
public
Active Model Observers Activation
Activates the observers assigned. Examples:
class ORM include ActiveModel::Observing end # Calls PersonObserver.instance ORM.observers = :person_observer # Calls Cacher.instance and GarbageCollector.instance ORM.observers = :cacher, :garbage_collector # Same as above, just using explicit class references ORM.observers = Cacher, GarbageCollector
Note: Setting this does not instantiate the observers yet. instantiate_observers is called during startup, and before each development request.