Slide 30
Slide 30 text
Wednesday, 13 June, 12
Now, that we have an observable object we can add our observers. All the need to do is
respond to the saw_flash function, and boom, they’ll know when changes happen to the
observed object.
To get an idea of where the Observer is used, we need look no further than Active Record.
We are able to create Model Observers so we can be notified when a model’s changed so we can
perform various actions based on however the content changed.