DEPRECATION WARNING: observer is deprecated

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. 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. 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.

On Oct 18, 6:42 am, amagoia [email protected] 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

essentialrails.com

Thank you very much!