From 9f5b1e1ed08df9dbedded0a6b7798d919d43b9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sun, 13 Mar 2011 08:35:50 +0100 Subject: Revert "It should be possible to use ActiveSupport::DescendantTracker without getting ActiveSupport::Dependencies for free." This reverts commit 46f6a2e3889bae420589f429b09722a37dbdf18d. Caused failures on CI. rake test:isolated on activesupport directory show them. --- activesupport/lib/active_support/descendants_tracker.rb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'activesupport/lib/active_support/descendants_tracker.rb') diff --git a/activesupport/lib/active_support/descendants_tracker.rb b/activesupport/lib/active_support/descendants_tracker.rb index e2a8b4d4e3..4d1cfacc95 100644 --- a/activesupport/lib/active_support/descendants_tracker.rb +++ b/activesupport/lib/active_support/descendants_tracker.rb @@ -1,3 +1,5 @@ +require 'active_support/dependencies' + module ActiveSupport # This module provides an internal implementation to track descendants # which is faster than iterating through ObjectSpace. @@ -16,16 +18,12 @@ module ActiveSupport end def self.clear - if defined? ActiveSupport::Dependencies - @@direct_descendants.each do |klass, descendants| - if ActiveSupport::Dependencies.autoloaded?(klass) - @@direct_descendants.delete(klass) - else - descendants.reject! { |v| ActiveSupport::Dependencies.autoloaded?(v) } - end + @@direct_descendants.each do |klass, descendants| + if ActiveSupport::Dependencies.autoloaded?(klass) + @@direct_descendants.delete(klass) + else + descendants.reject! { |v| ActiveSupport::Dependencies.autoloaded?(v) } end - else - @@direct_descendants.clear end end -- cgit v1.2.3