Forum: Ruby on Rails Observers, environment.rb and application.rb

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
7fe16d11ca75c2de9d29bcc08a85ab9c?d=identicon&s=25 Pedro Cardoso (jotape)
on 2007-04-11 12:30

I'm running some tests with Observers and I'm having trouble making them

I've tried to follow the code that's on the API, but that does not work.

I've name my Observer after a model, as said, and added it in
environment.rb. That does not work. I had to had it in application.rb,
like observer :my_observer to make it work. My problem is that that's
not very elegant...

Any ideas?

83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2007-04-11 14:52
(Received via mailing list)
I'd guess you are running Rails 1.1.6 or earlier. Newer versions of
properly use the environment.rb for setting observers and have removed
ActionController::Base#observer call.

7fe16d11ca75c2de9d29bcc08a85ab9c?d=identicon&s=25 Pedro Cardoso (jotape)
on 2007-04-11 15:11
Yes, that's a fact...

This topic is locked and can not be replied to.