This project is archived and is in readonly mode.
[PATCH] Add option to load default observers from app/models/*_observer.rb
-
Santiago Pastorino
- Milestone set to 3.x
- State changed from new to open
- Importance changed from to Low
Can you change that to allow
config.active_record.observers = 'app/models'
and
config.active_record.observers = :cacher, :garbage_collector, :forum_observer
so when you set observers as a string you call instantiate_observer of every *_observer.rb file
Also remember that you're coding in Active Model so references to Active Record are not welcome ;).
-
Santiago Pastorino
- Milestone changed from 3.x to 3.1
For the record we agreed on that ...
config.active_record.observer_path 'app/models/*_observer.rb' # default in railties
config.active_record.observer :cacher, :garbage_collector # in app, add two observers on top of defaults
config.active_record.observers = :cacher, :garbage_collector # in app, old style assignment explicitly sets these observers, clobbering defaultsold API would retain compatibility by wiping out defaults
-
Ravil Bayramgalin
So here are the new patches:
https://gist.github.com/780840 - [PATCH 1/3] Add observer_path method to load observers matching given pattern
https://gist.github.com/780842 - [PATCH 2/3] Replace ActiveRecord references in ActiveModel::Observing comments
https://gist.github.com/780843 - [PATCH 3/3] Update application.rb template to reflect observer changes -
José Valim
- State changed from open to wontfix