Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add documentation for ActiveRecord::Observer. #7043

Merged
merged 1 commit into from

3 participants

@kytrinyx

The instructions about configuration covered only rails-specific usage. This adds information on how to use observers in non-rails projects.

@kytrinyx kytrinyx Add documentation for ActiveRecord::Observer.
The instructions about configuration covered only rails-specific usage.
848c1b4
@fxn
Owner

Awesome, thanks!

@fxn fxn merged commit a734902 into from
@steveklabnik
Collaborator

:heart: :heart: :heart:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 13, 2012
  1. @kytrinyx

    Add documentation for ActiveRecord::Observer.

    kytrinyx authored
    The instructions about configuration covered only rails-specific usage.
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.