Permalink
Browse files

reverse the order in which parameter parsing capabilities are looked up

  • Loading branch information...
mislav committed May 20, 2009
1 parent fce2e9e commit 11ca129a7e80442e02fcff165188765dfed8732f
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/will_paginate/view_helpers.rb
@@ -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

0 comments on commit 11ca129

Please sign in to comment.