Forum: Ruby on Rails ActionController::observer deprecation fix?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
42f948adff3afaa52249d963117af7c8?d=identicon&s=25 Gregg Kellogg (gkellogg)
on 2007-01-27 02:35
(Received via mailing list)
ActioinController::observer generates a deprecation warning in 1.2,
however there doesn't seem to be a replacement.

I have a couple of cases where I have an observer (eg UserObserver)
that must be instantiated in order for the obserer to be called.
Removing the observer declaration at the beginning of the controller
eliminates the warning, but doesn't result in the observer being
called.

What is the right way to do this in 1.2?

Gregg
24d2f8804e6bb4b7ea6bd11e0a586470?d=identicon&s=25 Jeremy Kemper (Guest)
on 2007-01-27 09:01
(Received via mailing list)
On 1/25/07, Gregg <gregg@kellogg-assoc.com> wrote:
> ActioinController::observer generates a deprecation warning in 1.2,
> however there doesn't seem to be a replacement.
>
> I have a couple of cases where I have an observer (eg UserObserver)
> that must be instantiated in order for the obserer to be called.
> Removing the observer declaration at the beginning of the controller
> eliminates the warning, but doesn't result in the observer being
> called.
>
> What is the right way to do this in 1.2?

In config/environment.rb set
  config.active_record.observers = [:user]

jeremy
Ee0293412faca21e4ebf3326ed9d5f8c?d=identicon&s=25 Kad Kerforn (kadoudal)
on 2007-02-11 18:07
Jeremy Kemper wrote:
> On 1/25/07, Gregg <gregg@kellogg-assoc.com> wrote:
>> ActioinController::observer generates a deprecation warning in 1.2,
>> however there doesn't seem to be a replacement.
>>
>> I have a couple of cases where I have an observer (eg UserObserver)
>> that must be instantiated in order for the obserer to be called.
>> Removing the observer declaration at the beginning of the controller
>> eliminates the warning, but doesn't result in the observer being
>> called.
>>
>> What is the right way to do this in 1.2?
>
> In config/environment.rb set
>   config.active_record.observers = [:user]
>
> jeremy

nice to get this info... but where can we find the documentation about
this 'right way'.. thanks
This topic is locked and can not be replied to.