diff options
author | Katrina Owen <katrina.owen@gmail.com> | 2012-07-13 18:58:29 +0200 |
---|---|---|
committer | Katrina Owen <katrina.owen@gmail.com> | 2012-07-13 18:58:29 +0200 |
commit | 848c1b4f47dd64ea2ca1d4547f1d8a74214335c4 (patch) | |
tree | b11f516751b9e7c43e6c22f08120e7a91c0bc5bf /activerecord | |
parent | 35edd185e15cf23546ff055a1e1d65d6b804dc1a (diff) | |
download | rails-848c1b4f47dd64ea2ca1d4547f1d8a74214335c4.tar.gz rails-848c1b4f47dd64ea2ca1d4547f1d8a74214335c4.tar.bz2 rails-848c1b4f47dd64ea2ca1d4547f1d8a74214335c4.zip |
Add documentation for ActiveRecord::Observer.
The instructions about configuration covered only rails-specific usage.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/observer.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/observer.rb b/activerecord/lib/active_record/observer.rb index fdf17c003c..e940d357da 100644 --- a/activerecord/lib/active_record/observer.rb +++ b/activerecord/lib/active_record/observer.rb @@ -74,6 +74,12 @@ module ActiveRecord # # Observers will not be invoked unless you define these in your application configuration. # + # If you are using Active Record outside Rails, activate the observers explicitly in a configuration or + # environment file: + # + # ActiveRecord::Base.add_observer CommentObserver.instance + # ActiveRecord::Base.add_observer SignupObserver.instance + # # == Loading # # Observers register themselves in the model class they observe, since it is the class that |