0
0
Fork 0

fix namespace leak

This commit is contained in:
Gibheer 2013-10-27 19:46:02 +01:00
parent 6c1cb50af0
commit 5b54051db6
1 changed files with 2 additions and 2 deletions

View File

@ -3,7 +3,6 @@ class Router
# get the controller handling the request
def self.call(session)
variables = session.request.path.match(ROUTE_REGEX)
puts variables.inspect
return default_route unless variables && variables[:controller]
session.options[:id] = variables[:id]
find(variables[:controller])
@ -32,7 +31,8 @@ class Router
# check for the controller name and return 404 when not found
def self.find(ctrl)
ctrl = ctrl.capitalize
return namespace.const_get(ctrl) if namespace.const_defined?(ctrl)
# make constant lookup without ancestors
return namespace.const_get(ctrl, false) if namespace.const_defined?(ctrl, false)
namespace::RouteNotFound
end
end