Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Section A.11. Observing

A.11. Observing

Observing is a module to include in your models to set up observers in the lifecycle of your model. Observers are added to the class by calling the observers class method at some point in the application bootstrapping. An initializer would be a good fit for this.

class User
  include ActiveModel::Observing
end

User.observers = Logging


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial