Permalink
Browse files

My fix for Rails 3.2 tie-in

  • Loading branch information...
1 parent 6f4390b commit 87c79550d8207f3187dca3f29fc407cc2697c49c @calvincorreli committed Dec 24, 2011
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/will_paginate/railtie.rb
@@ -41,13 +41,11 @@ module ShowExceptionsPatch
extend ActiveSupport::Concern
included { alias_method_chain :status_code, :paginate }
private
- def status_code_with_paginate(exception = self.exception)
- if exception.is_a?(WillPaginate::InvalidPage) or
- (exception.respond_to?(:original_exception) &&
- exception.original_exception.is_a?(WillPaginate::InvalidPage))
+ def status_code_with_paginate
+ if @exception.is_a?(WillPaginate::InvalidPage)
Rack::Utils.status_code(:not_found)
else
- status_code_without_paginate(exception)
+ status_code_without_paginate
end
end
end

0 comments on commit 87c7955

Please sign in to comment.