aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/observer_array.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug with AM::Observer disablement.Myron Marston2011-04-281-22/+8
| | | | | Now that we propagate the enabling/disabling to descendants, we no longer have to check the disabled_observer Set on each superclass of the model class. This was causing a bug when disabling all observers at a superclass level and then enabling an individual observer at a subclass level. Plus the logic is simpler now :).
* Fix dev env memory leaks by using AS::DescendantsTracker rather than keeping ↵Myron Marston2011-04-281-13/+5
| | | | | track of subclasses manually. There's also no need to keep track of all ObserverArray instances in a hash, as this is likely to leak memory, too.
* Revert "Revert "Handle enabling/disabling observers at different levels of ↵Myron Marston2011-04-281-3/+31
| | | | | | | | | the class hierarchy."" This reverts commit 2a25c5818b03d7d6cd63aad180bff23479dbd861. I'm going to add another commit that keeps the same behavior of fixes the problems of leaking memory in development.
* Revert "Handle enabling/disabling observers at different levels of the class ↵José Valim2011-04-281-31/+3
| | | | | | | | | | hierarchy." This reverts commit ad62f1928768bd2676958a4a08512bad342fe469 because the current subclasses implementation leaks memory in development. Instead of keeping an array of subclasses, the better solution is to ask the parent if an observer is being disabled or not.
* Handle enabling/disabling observers at different levels of the class hierarchy.Myron Marston2011-04-281-3/+31
| | | | Last call wins.
* Allow observers to be enabled and disabled.Myron Marston2011-04-281-0/+98
This is useful in situations like model unit tests and the occasional rake task to backfill old data.