I have a namespace as admin and in this i have class as Admin::Business.
I want to add observer to it. I tried to add a class
Admin::BusinessObserver
and adding the observer in environment.rb like
config.active_record.observers = [Admin::BusinessObserver]. but it does
not
work. Can anybody guide me to add observer to namespaced classes.
with Rails 3.1 this worked for me:
config.active_record.observers = [ :“Admin::BusinessObserver” ]
Came up from looking at how the active_record.observer list is parsed in
gems/1.8/gems/activemodel-3.1.0/lib/active_model/observing.rb line 86
Bruno
Ankit Varshney wrote in post #907087:
I have a namespace as admin and in this i have class as Admin::Business.
I want to add observer to it. I tried to add a class
Admin::BusinessObserver
and adding the observer in environment.rb like
config.active_record.observers = [Admin::BusinessObserver]. but it does
not
work. Can anybody guide me to add observer to namespaced classes.