diff options
Diffstat (limited to 'activesupport/lib/active_support/descendants_tracker.rb')
-rw-r--r-- | activesupport/lib/active_support/descendants_tracker.rb | 5 |
1 files changed, 4 insertions, 1 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) |