1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

6 commits

Author SHA1 Message Date
Myron Marston
7db7aa5053 Add additional tests for AM::ObserverArray that I had missed yesterday. 2011-04-28 08:32:22 -07:00
Myron Marston
fef22157b0 Fix bug with AM::Observer disablement.
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 :).
2011-04-28 08:27:15 -07:00
Myron Marston
05d4653cef Revert "Revert "Handle enabling/disabling observers at different levels of the class hierarchy.""
This reverts commit 2a25c5818b.

I'm going to add another commit that keeps the same behavior of fixes
the problems of leaking memory in development.
2011-04-28 07:58:58 -07:00
José Valim
2a25c5818b Revert "Handle enabling/disabling observers at different levels of the class hierarchy."
This reverts commit ad62f19287 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.
2011-04-28 09:32:57 +02:00
Myron Marston
ad62f19287 Handle enabling/disabling observers at different levels of the class hierarchy.
Last call wins.
2011-04-28 10:25:07 +08:00
Myron Marston
1f8cc446d9 Allow observers to be enabled and disabled.
This is useful in situations like model unit tests and the occasional rake task to backfill old data.
2011-04-28 10:23:49 +08:00