# ActionController::observer deprecation fix?

**URL:** <https://www.ruby-forum.com/t/actioncontroller-observer-deprecation-fix/83553>\
**Category:** Rails\
**Created:** [January 27, 2007, 2:35am UTC](https://www.ruby-forum.com/t/actioncontroller-observer-deprecation-fix/83553 "2007-01-27T02:35:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gkellogg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/73ab20/32.png) [@gkellogg](https://www.ruby-forum.com/u/gkellogg)\
**Post date:** [January 27, 2007, 2:35am UTC](https://www.ruby-forum.com/t/actioncontroller-observer-deprecation-fix/83553/1 "2007-01-27T02:35:38Z")

</div>

ActioinController::observer generates a deprecation warning in 1.2,  
however there doesn’t seem to be a replacement.

I have a couple of cases where I have an observer (eg UserObserver)  
that must be instantiated in order for the obserer to be called.  
Removing the observer declaration at the beginning of the controller  
eliminates the warning, but doesn’t result in the observer being  
called.

What is the right way to do this in 1.2?

Gregg

---

<div class="post-metadata">

**Author:** ![gkellogg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/73ab20/32.png) [@gkellogg](https://www.ruby-forum.com/u/gkellogg)\
**Post date:** [January 27, 2007, 9:01am UTC](https://www.ruby-forum.com/t/actioncontroller-observer-deprecation-fix/83553/2 "2007-01-27T09:01:03Z")

</div>

On 1/25/07, Gregg [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ActioinController::observer generates a deprecation warning in 1.2,  
> however there doesn’t seem to be a replacement.
> 
> I have a couple of cases where I have an observer (eg UserObserver)  
> that must be instantiated in order for the obserer to be called.  
> Removing the observer declaration at the beginning of the controller  
> eliminates the warning, but doesn’t result in the observer being  
> called.
> 
> What is the right way to do this in 1.2?

In config/environment.rb set  
config.active\_record.observers = [:user]

jeremy

---

<div class="post-metadata">

**Author:** ![gkellogg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/73ab20/32.png) [@gkellogg](https://www.ruby-forum.com/u/gkellogg)\
**Post date:** [February 11, 2007, 6:07pm UTC](https://www.ruby-forum.com/t/actioncontroller-observer-deprecation-fix/83553/3 "2007-02-11T18:07:54Z")

</div>

Jeremy K. wrote:

> On 1/25/07, Gregg [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > ActioinController::observer generates a deprecation warning in 1.2,  
> > however there doesn’t seem to be a replacement.
> > 
> > I have a couple of cases where I have an observer (eg UserObserver)  
> > that must be instantiated in order for the obserer to be called.  
> > Removing the observer declaration at the beginning of the controller  
> > eliminates the warning, but doesn’t result in the observer being  
> > called.
> > 
> > What is the right way to do this in 1.2?
> 
> In config/environment.rb set  
> config.active\_record.observers = [:user]
> 
> jeremy

nice to get this info… but where can we find the documentation about  
this ‘right way’… thanks
