elabs/pundit — pull request #109 by jnicklas (2014-02-14 13:01:50+00:00)
Title: Raise a different error when authorization is not performed

Authorization should always be performed before rendering, so `authorize` should under normal circumstances not lead to a `DoubleRenderError`. As noted in the README addition added in #108, `verify_authorized` is performed in an after filter, after rendering has already been performed. This leads to `DoubleRenderError` when the user has specified a `rescue_from Pundit::NotAuthorizedError` in their controller.

The way around this is to simply raise a different exception. Since you never want this exception to happen in production anyway, there's no need to add a `rescue_from` clause for this error, and so the `DoubleRenderError` problem is no longer relevant.