diff options
| -rw-r--r-- | activesupport/lib/active_support/descendants_tracker.rb | 5 | ||||
| -rw-r--r-- | activesupport/test/descendants_tracker_test.rb | 2 | 
2 files changed, 5 insertions, 2 deletions
| diff --git a/activesupport/lib/active_support/descendants_tracker.rb b/activesupport/lib/active_support/descendants_tracker.rb index a9379bf95b..a587d7770c 100644 --- a/activesupport/lib/active_support/descendants_tracker.rb +++ b/activesupport/lib/active_support/descendants_tracker.rb @@ -4,9 +4,12 @@ module ActiveSupport    # This module provides an internal implementation to track descendants    # which is faster than iterating through ObjectSpace.    module DescendantsTracker -    mattr_accessor :descendants      @@descendants = Hash.new { |h, k| h[k] = [] } +    def self.descendants +      @@descendants +    end +      def self.clear        @@descendants.each do |klass, descendants|          if ActiveSupport::Dependencies.autoloaded?(klass) diff --git a/activesupport/test/descendants_tracker_test.rb b/activesupport/test/descendants_tracker_test.rb index e3eccb8aa9..3a424180de 100644 --- a/activesupport/test/descendants_tracker_test.rb +++ b/activesupport/test/descendants_tracker_test.rb @@ -70,6 +70,6 @@ class DescendantsTrackerTest < Test::Unit::TestCase      yield    ensure      ActiveSupport::Dependencies.autoloaded_constants = old_autoloaded -    ActiveSupport::DescendantsTracker.descendants = old_descendants +    ActiveSupport::DescendantsTracker.descendants.replace(old_descendants)    end  end
\ No newline at end of file | 
