Fixes a bug in routes controller traversing which caused it to fail on for double nested controllers. [Tobias Luetke]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3879 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Tobias Lütke
2006-03-15 22:48:22 +00:00
parent 2429074075
commit 7bbc759dc0

View File

@@ -241,7 +241,7 @@ module ActionController
return controller, (index - start_at)
end
rescue NameError => e
raise unless /^uninitialized constant #{controller_name}$/ =~ e.message
raise unless /^uninitialized constant .*#{controller_name}$/ =~ e.message
end
begin
@@ -249,7 +249,8 @@ module ActionController
# Check that we didn't get a module from a parent namespace
mod = (mod == Object || next_mod.name == "#{mod.name}::#{mod_name}") ? next_mod : nil
rescue NameError => e
raise unless /^uninitialized constant #{mod_name}$/ =~ e.message
breakpoint
raise unless /^uninitialized constant .*#{mod_name}$/ =~ e.message
end
return nil unless mod