# DEPRECATION WARNING: observer is deprecated

**URL:** <https://www.ruby-forum.com/t/deprecation-warning-observer-is-deprecated/117601>\
**Category:** Rails\
**Created:** [October 18, 2007, 1:43pm UTC](https://www.ruby-forum.com/t/deprecation-warning-observer-is-deprecated/117601 "2007-10-18T13:43:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amagoia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@amagoia](https://www.ruby-forum.com/u/amagoia)\
**Post date:** [October 18, 2007, 1:43pm UTC](https://www.ruby-forum.com/t/deprecation-warning-observer-is-deprecated/117601/1 "2007-10-18T13:43:53Z")

</div>

Hello,

I am getting the following warning:

DEPRECATION WARNING: observer is deprecated and will be removed from  
Rails 2.0 See [Ruby on Rails — A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.](http://www.rubyonrails.org/deprecation) for details.

And I would like to know how do I have to replace the  
ActiveRecord::Observer class. Nowadays, I am using Ruby 1.8.6, do I  
have to change it for the 2.0 version?

I have done a small research, but found almost nothing. On the  
[Ruby on Rails — A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.](http://www.rubyonrails.org/deprecation) there is nothing about  
observer.

Then,I have read somewhere is that “What’s deprecated is calling  
‘observer’ from a controller. Instead, you need to set it in your  
config/environment.rb file:  
config.active\_record.observers = :user\_observer”

Is it correct? Otherwise what I should change?

Thank you for your help,

Amagoia.

---

<div class="post-metadata">

**Author:** ![amagoia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@amagoia](https://www.ruby-forum.com/u/amagoia)\
**Post date:** [October 18, 2007, 3:47pm UTC](https://www.ruby-forum.com/t/deprecation-warning-observer-is-deprecated/117601/2 "2007-10-18T15:47:27Z")

</div>

On Oct 18, 6:42 am, amagoia [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Then,I have read somewhere is that “What’s deprecated is calling  
> ‘observer’ from a controller. Instead, you need to set it in your  
> config/environment.rb file:  
> config.active\_record.observers = :user\_observer”
> 
> Is it correct? Otherwise what I should change?

Yes, that’s correct, you need to list your observers in that line  
instead of calling the old “observer” method in your controller.

Jeff

> **[Hey Daddio!](http://softiesonrails.com)**
>
> Home of Hey Daddio Software

[essentialrails.com](http://essentialrails.com)

---

<div class="post-metadata">

**Author:** ![amagoia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/edb3f5/32.png) [@amagoia](https://www.ruby-forum.com/u/amagoia)\
**Post date:** [October 19, 2007, 11:52am UTC](https://www.ruby-forum.com/t/deprecation-warning-observer-is-deprecated/117601/3 "2007-10-19T11:52:28Z")

</div>

Thank you very much!
