Skip to content

Commit

Permalink
reverse the order in which parameter parsing capabilities are looked up
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed May 20, 2009
1 parent fce2e9e commit 11ca129
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/will_paginate/view_helpers.rb
Expand Up @@ -386,16 +386,18 @@ def stringified_merge(target, other)
end

def parse_query_parameters(params)
if defined?(CGIMethods)
CGIMethods.parse_query_parameters(params)
if defined? Rack::Utils
# For Rails > 2.3
Rack::Utils.parse_nested_query(params)
elsif defined?(ActionController::AbstractRequest)
ActionController::AbstractRequest.parse_query_parameters(params)
elsif defined?(ActionController::UrlEncodedPairParser)
# For Rails > 2.2
ActionController::UrlEncodedPairParser.parse_query_parameters(params)
elsif defined?(CGIMethods)
CGIMethods.parse_query_parameters(params)
else
# For Rails > 2.3
Rack::Utils.parse_nested_query(params)
raise "unsupported ActionPack version"
end
end
end
Expand Down

0 comments on commit 11ca129

Please sign in to comment.