Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #7043 from kytrinyx/documentation-ar-observer

Add documentation for ActiveRecord::Observer.
  • Loading branch information...
commit a734902e9a1c64dd36b0ff08db44707c9f870e17 2 parents 35edd18 + 848c1b4
@fxn fxn authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 activerecord/lib/active_record/observer.rb
View
6 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
Please sign in to comment.
Something went wrong with that request. Please try again.