# Adding observers outside environment.rb

**URL:** <https://www.ruby-forum.com/t/adding-observers-outside-environment-rb/128127>\
**Category:** Rails\
**Created:** [February 5, 2008, 7:40am UTC](https://www.ruby-forum.com/t/adding-observers-outside-environment-rb/128127 "2008-02-05T07:40:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ke\_han](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/839c29/32.png) [@ke\_han](https://www.ruby-forum.com/u/ke_han)\
**Post date:** [February 5, 2008, 7:40am UTC](https://www.ruby-forum.com/t/adding-observers-outside-environment-rb/128127/1 "2008-02-05T07:40:13Z")

</div>

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
