From 26f28e7cfaa91fa03af7fae15246cd38f917d443 Mon Sep 17 00:00:00 2001 From: Nicholas Seckar Date: Sat, 2 Sep 2006 21:13:30 +0000 Subject: Add ApplicationController special case to Dependencies. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4910 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/dependencies.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index 7a74884dc7..39244b23be 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -123,6 +123,7 @@ module Dependencies #:nodoc: def loadable_constants_for_path(path, bases = load_paths - load_once_paths) path = $1 if path =~ /\A(.*)\.rb\Z/ expanded_path = File.expand_path(path) + bases.collect do |root| expanded_root = File.expand_path root next unless expanded_path.starts_with? expanded_root @@ -131,8 +132,13 @@ module Dependencies #:nodoc: nesting = nesting[1..-1] if nesting && nesting[0] == ?/ next if nesting.blank? - nesting.camelize - end.compact.uniq + names = [nesting.camelize] + + # Special case: application.rb might define ApplicationControlller. + names << 'ApplicationController' if nesting == 'application' + + names + end.flatten.compact.uniq end # Search for a file in load_paths matching the provided suffix. -- cgit v1.2.3