diff options
author | José Valim <jose.valim@gmail.com> | 2011-04-28 09:32:57 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-04-28 09:32:57 +0200 |
commit | 2a25c5818b03d7d6cd63aad180bff23479dbd861 (patch) | |
tree | 251fa94604fc45a6edf273fb089ff0fe8181ff58 /activemodel/test | |
parent | 5297049e32c3b176893e7ef029d9fa22f2003409 (diff) | |
download | rails-2a25c5818b03d7d6cd63aad180bff23479dbd861.tar.gz rails-2a25c5818b03d7d6cd63aad180bff23479dbd861.tar.bz2 rails-2a25c5818b03d7d6cd63aad180bff23479dbd861.zip |
Revert "Handle enabling/disabling observers at different levels of the class 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.
Diffstat (limited to 'activemodel/test')
-rw-r--r-- | activemodel/test/cases/observer_array_test.rb | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/activemodel/test/cases/observer_array_test.rb b/activemodel/test/cases/observer_array_test.rb index 38e4fd59fc..215ca80bb4 100644 --- a/activemodel/test/cases/observer_array_test.rb +++ b/activemodel/test/cases/observer_array_test.rb @@ -118,44 +118,5 @@ class ObserverArrayTest < ActiveModel::TestCase ORM.observers.disable Widget end end - - test "allows #enable at the superclass level to override #disable at the subclass level when called last" do - Widget.observers.disable :all - ORM.observers.enable :all - - assert_observer_notified Widget, WidgetObserver - assert_observer_notified Budget, BudgetObserver - assert_observer_notified Widget, AuditTrail - assert_observer_notified Budget, AuditTrail - end - - test "allows #disable at the superclass level to override #enable at the subclass level when called last" do - Budget.observers.enable :audit_trail - ORM.observers.disable :audit_trail - - assert_observer_notified Widget, WidgetObserver - assert_observer_notified Budget, BudgetObserver - assert_observer_not_notified Widget, AuditTrail - assert_observer_not_notified Budget, AuditTrail - end - - test "can use the block form at different levels of the hierarchy" do - yielded = false - Widget.observers.disable :all - - ORM.observers.enable :all do - yielded = true - assert_observer_notified Widget, WidgetObserver - assert_observer_notified Budget, BudgetObserver - assert_observer_notified Widget, AuditTrail - assert_observer_notified Budget, AuditTrail - end - - assert yielded - assert_observer_not_notified Widget, WidgetObserver - assert_observer_notified Budget, BudgetObserver - assert_observer_not_notified Widget, AuditTrail - assert_observer_notified Budget, AuditTrail - end end |