Rails 3 observers

Rails Guides says:
…the UserObserver … would be saved as app/models/user_observer.rb
and registered in config/environment.rb this way:
config.active_record.observers = :user_observer

But the observer registration above doesn’t work because there is no
‘config’. For now, I’ve put it in the config/environments/[APP_ENV].rb
but that seems really sloppy and redundant.

What am I missing here?


If you are using rails 3 the configuration goes in the application.rb
in the config folder. Look at line 23.

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