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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jason Roelofs
2008-Jan-06 15:10 UTC
Re: observer is deprecated and will be removed from Rails 2.0
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 8:10 AM, oldbear <1380127-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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 > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rick DeNatale
2008-Jan-06 19:30 UTC
Re: observer is deprecated and will be removed from Rails 2.0
On Jan 6, 2008 10:10 AM, Jason Roelofs <jameskilton-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 > ... > endWhich means that it''s much less likely to hear your models singing that old Michael Jackson tune: "I always feel like, somebody''s watching me!" -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---