diff options
author | José Valim <jose.valim@gmail.com> | 2011-03-13 08:35:50 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-03-13 08:35:50 +0100 |
commit | 9f5b1e1ed08df9dbedded0a6b7798d919d43b9a6 (patch) | |
tree | 45389ab701658871e08e72cb3816f1ef9c403890 /activesupport/lib | |
parent | 157c37f55854a17fcb50e77b7636fab01773df3c (diff) | |
download | rails-9f5b1e1ed08df9dbedded0a6b7798d919d43b9a6.tar.gz rails-9f5b1e1ed08df9dbedded0a6b7798d919d43b9a6.tar.bz2 rails-9f5b1e1ed08df9dbedded0a6b7798d919d43b9a6.zip |
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.
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/descendants_tracker.rb | 16 |
1 files changed, 7 insertions, 9 deletions
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 |