mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Update documentation for observers to reflect new configuration system.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2766 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
beff664f2a
commit
0ba5bd583b
1 changed files with 4 additions and 3 deletions
|
@ -74,9 +74,10 @@ module ActiveRecord
|
|||
#
|
||||
# == Triggering Observers
|
||||
#
|
||||
# In order to activate an observer, you need to call Observer.instance. In Rails, this can be done in controllers
|
||||
# using the short-hand of for example observer :comment_observer. Or directly from Active Record, with
|
||||
# ActiveRecord::Base.observer(:comment_observer).
|
||||
# In order to activate an observer, list it in the <tt>config.active_record.observers</tt> configuration setting in your
|
||||
# <tt>config/environment.rb</tt> file.
|
||||
#
|
||||
# config.active_record.observers = :comment_observer, :signup_observer
|
||||
class Observer
|
||||
include Singleton
|
||||
|
||||
|
|
Loading…
Reference in a new issue