Permalink
Browse files

Revert "It should be possible to use ActiveSupport::DescendantTracker…

… without getting ActiveSupport::Dependencies for free."

This reverts commit 46f6a2e.

Caused failures on CI. rake test:isolated on activesupport directory show them.
  • Loading branch information...
1 parent 157c37f commit 9f5b1e1ed08df9dbedded0a6b7798d919d43b9a6 @josevalim josevalim committed Mar 13, 2011
Showing with 7 additions and 9 deletions.
  1. +7 −9 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 @@ def self.descendants(klass)
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

0 comments on commit 9f5b1e1

Please sign in to comment.