Observer is deprecated and will be removed from Rails 2.0

hi guys

rails 1.2.6

run my code and find:

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.
(called from D:/repos/rails_test/app/controllers/user_controller.rb:2)

Is this any solution ? thanks

Observer definitions have been moved to your config/environment.rb file.
So
instead of

class MyModel < …
observer :email_observer
end

it’s

config.active_record.observers = [ :observer1, :observer2, … ]

and

class Observer1 < ActiveRecord::Observer
observe :my_model

end

Jason

On Jan 6, 2008 10:10 AM, Jason R. [email protected] wrote:

and

class Observer1 < ActiveRecord::Observer
observe :my_model

end

Which means that it’s much less likely to hear your models singing
that old Michael J. tune:

“I always feel like, somebody’s watching me!”


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/