Permalink
Browse files

fix few Rails 1.2.6 bugs

  • Loading branch information...
mislav committed Jul 29, 2011
1 parent f799143 commit b11cfff1d1396fd69029c04a4628c153f3d5d481
Showing with 4 additions and 3 deletions.
  1. +3 −2 lib/will_paginate/view_helpers.rb
  2. +1 −1 test/view_test.rb
@@ -142,7 +142,7 @@ def will_paginate(collection = nil, options = {})
def paginated_section(*args, &block)
pagination = will_paginate(*args).to_s
- unless ActionView::Base.respond_to? :erb_variable
+ if respond_to? :output_buffer
concat pagination
yield
concat pagination
@@ -395,7 +395,8 @@ def parse_query_parameters(params)
if defined? Rack::Utils
# For Rails > 2.3
Rack::Utils.parse_nested_query(params)
- elsif defined?(ActionController::AbstractRequest)
+ elsif defined?(ActionController::AbstractRequest) and
+ ActionController::AbstractRequest.respond_to? :parse_query_parameters
ActionController::AbstractRequest.parse_query_parameters(params)
elsif defined?(ActionController::UrlEncodedPairParser)
# For Rails > 2.2
View
@@ -283,7 +283,7 @@ def test_will_paginate_with_atmark_url
renderer = WillPaginate::LinkRenderer.new
paginate({ :page => 1 }, :renderer=>renderer)
- assert_links_match %r[/foo/@tag\?page=\d]
+ assert_links_match %r[/foo/(?:@|%40)tag\?page=\d]
end
def test_complex_custom_page_param

0 comments on commit b11cfff

Please sign in to comment.