adding observers outside environment.rb

ke han
Tue, 05 Feb 2008 06:39:32 -0000

I need to add an ActiveRecord observer and thought I should follow
Rails 2 intent by not changing the base environment.rb
I create a file config/initializers/observers.rb but don''t know what
to add to it.

I can''t add:  config.active_record.observers = :user_observer
Since "config" isn''t defined in the scope of the initializer
file and
I don''t know if it would be harmful to add a
"Rails::Initializer.run
do |config| " block.

So, is there a method to add an observer outside the environment.rb
initializer block?
Or is it ok to have a second initializers block in my other
"initializers/" files?

thanks, Jon
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---