Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Error during Rails 3.2 fail-safe response #215

Closed
wants to merge 1 commit into from

3 participants

Calvin Correli Mislav Marohnić Henrik Nyh
Calvin Correli

Did Rails 3.2 change since your change?

It looks like there's a bug again - status_code no longer takes any params.

Here's my fix - not sure if it's correct...

//Lars

Mislav Marohnić
Owner

Weird. I thought my code worked but now that you pointed it out, status_code indeed doesn't take an argument.

I'll incorporate this in somehow. Thanks

Henrik Nyh

+1 for including this patch. Rails 3.2 with will_paginate shows 500 errors instead of debug info on dev errors, and instead of the 404 page in production.

Mislav Marohnić mislav closed this pull request from a commit
Mislav Marohnić fix the ExceptionWrapper patch
Closes #215
e5e6c47
Mislav Marohnić mislav closed this in e5e6c47
Mislav Marohnić
Owner

@henrik all is well now in new 3.0.3 release. Sorry for the trouble.

Henrik Nyh

@mislav No worries. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 24, 2011
  1. My fix for Rails 3.2 tie-in

    Lars Pind authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/will_paginate/railtie.rb
8 lib/will_paginate/railtie.rb
View
@@ -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
Something went wrong with that request. Please try again.