diff options
author | Yehuda Katz <yehudakatz@YK.local> | 2010-02-19 10:10:45 -0800 |
---|---|---|
committer | Yehuda Katz <yehudakatz@YK.local> | 2010-02-19 10:12:04 -0800 |
commit | 2f98032fc92ce16125f8628b4d3c283f10494f4d (patch) | |
tree | 92dc34927eb23f6ab7baf8f50af7804bbefdbff6 | |
parent | 7d7f9ccfdf986099e3c5abf05af37a886daba0b5 (diff) | |
download | rails-2f98032fc92ce16125f8628b4d3c283f10494f4d.tar.gz rails-2f98032fc92ce16125f8628b4d3c283f10494f4d.tar.bz2 rails-2f98032fc92ce16125f8628b4d3c283f10494f4d.zip |
Fix a problem where nil was appearing in the list
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index da1050298b..a3a7df7464 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -76,17 +76,19 @@ module ActiveSupport #:nodoc: locked :concat, :each, :delete_if, :<< def new_constants_for(frames) - frames.map do |mod_name, prior_constants| + constants = [] + frames.each do |mod_name, prior_constants| mod = Inflector.constantize(mod_name) if Dependencies.qualified_const_defined?(mod_name) next unless mod.is_a?(Module) new_constants = mod.local_constant_names - prior_constants get(mod_name).concat(new_constants) - new_constants.map do |suffix| - ([mod_name, suffix] - ["Object"]).join("::") + new_constants.each do |suffix| + constants << ([mod_name, suffix] - ["Object"]).join("::") end - end.flatten + end + constants end # Add a set of modules to the watch stack, remembering the initial constants |