ActionController::observer deprecation fix?


#1

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


#2

On 1/25/07, Gregg removed_email_address@domain.invalid 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


#3

Jeremy K. wrote:

On 1/25/07, Gregg removed_email_address@domain.invalid 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