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 http://www.rubyonrails.org/deprecation 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/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs