Permalink
Browse files

Switch to action_dispatch rack namespace

  • Loading branch information...
1 parent 7b3b7cb commit ba9887c9c02a3671c3d1d893cbee9f360ea2df2d @josh josh committed Apr 30, 2009
@@ -109,7 +109,7 @@ def assign_parameters(controller_path, action, parameters)
end
def recycle!
- @env["action_controller.request.request_parameters"] = {}
+ @env["action_dispatch.request.request_parameters"] = {}
self.query_parameters = {}
self.path_parameters = {}
@headers, @request_method, @accepts, @content_type = nil, nil, nil, nil
@@ -437,13 +437,13 @@ def form_data?
# Override Rack's GET method to support indifferent access
def GET
- @env["action_controller.request.query_parameters"] ||= normalize_parameters(super)
+ @env["action_dispatch.request.query_parameters"] ||= normalize_parameters(super)
end
alias_method :query_parameters, :GET
# Override Rack's POST method to support indifferent access
def POST
- @env["action_controller.request.request_parameters"] ||= normalize_parameters(super)
+ @env["action_dispatch.request.request_parameters"] ||= normalize_parameters(super)
end
alias_method :request_parameters, :POST
@@ -11,7 +11,7 @@ def initialize(app)
def call(env)
if params = parse_formatted_parameters(env)
- env["action_controller.request.request_parameters"] = params
+ env["action_dispatch.request.request_parameters"] = params
end
@app.call(env)
@@ -307,7 +307,7 @@ def teardown
test "restrict method hacking" do
[:get, :put, :delete].each do |method|
request = stub_request 'REQUEST_METHOD' => method.to_s.upcase,
- 'action_controller.request.request_parameters' => { :_method => 'put' }
+ 'action_dispatch.request.request_parameters' => { :_method => 'put' }
assert_equal method, request.method
end
end

0 comments on commit ba9887c

Please sign in to comment.