aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-12-10 23:45:04 -0600
committerJoshua Peek <josh@joshpeek.com>2009-12-10 23:45:04 -0600
commit2f90d700498294a9a4da0baa5317c0e6feaaf176 (patch)
tree7dd25f66023ae29027ebf24bd8c82f5db08d6140 /actionpack/lib/action_dispatch
parentd1191507bc8ffa4f7fe59b1cfb03dfbf6b73a798 (diff)
downloadrails-2f90d700498294a9a4da0baa5317c0e6feaaf176.tar.gz
rails-2f90d700498294a9a4da0baa5317c0e6feaaf176.tar.bz2
rails-2f90d700498294a9a4da0baa5317c0e6feaaf176.zip
Kill RouteSet#recognize
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb12
-rw-r--r--actionpack/lib/action_dispatch/testing/assertions/routing.rb6
2 files changed, 4 insertions, 14 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 664babd12e..8d56c4d087 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -479,12 +479,6 @@ module ActionDispatch
end
end
- def recognize(request)
- params = recognize_path(request.path, extract_request_environment(request))
- request.path_parameters = params.with_indifferent_access
- "#{params[:controller].to_s.camelize}Controller".constantize
- end
-
def recognize_path(path, environment = {}, rescue_error = true)
method = (environment[:method] || "GET").to_s.upcase
@@ -499,12 +493,6 @@ module ActionDispatch
status, headers, body = call(env)
body
end
-
- # Subclasses and plugins may override this method to extract further attributes
- # from the request, for use by route conditions and such.
- def extract_request_environment(request)
- { :method => request.method }
- end
end
end
end
diff --git a/actionpack/lib/action_dispatch/testing/assertions/routing.rb b/actionpack/lib/action_dispatch/testing/assertions/routing.rb
index e6d6b5a3ef..4bc5275e04 100644
--- a/actionpack/lib/action_dispatch/testing/assertions/routing.rb
+++ b/actionpack/lib/action_dispatch/testing/assertions/routing.rb
@@ -134,9 +134,11 @@ module ActionDispatch
# Assume given controller
request = ActionController::TestRequest.new
request.env["REQUEST_METHOD"] = request_method.to_s.upcase if request_method
- request.path = path
+ request.path = path
+
+ params = ActionController::Routing::Routes.recognize_path(path, { :method => request.method })
+ request.path_parameters = params.with_indifferent_access
- ActionController::Routing::Routes.recognize(request)
request
end
end