Class: Mongoid::Observer
- Defined in:
- lib/mongoid/observer.rb
Overview
Mongoid observers hook into the lifecycle of documents.
Instance Method Summary collapse
-
#initialize ⇒ Observer
constructor
Instantiate the new observer.
Constructor Details
#initialize ⇒ Observer
Instantiate the new observer. Will add all child observers as well.
13 14 15 |
# File 'lib/mongoid/observer.rb', line 13 def initialize super and observed_descendants.each { |klass| add_observer!(klass) } end |