Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Fix to enable better error message on middleware.insert_before

#3679

Patch against Rails 3.0.pre (edge)

Without the patch, if you try this:

...middleware.insert_before(
  Non::Existent::Middleware,
  My::Middleware
)

You get:

Exiting /Users/nwiger/Workspace/op/proto/fbapp/vendor/gems/dirs/rails/actionpack/lib/action_dispatch/middleware/stack.rb:90:in insert': no implicit conversion from nil to integer (TypeError)

from /Users/nwiger/Workspace/op/proto/fbapp/vendor/gems/dirs/rails/actionpack/lib/action_dispatch/middleware/stack.rb:90:in `insert'

But insert_after already has better handling, so I just adapted that to insert_before. So with the patch, you now get:

Exiting

/Users/nwiger/Workspace/op/proto/fbapp/vendor/gems/dirs/rails/actionpack/lib/action_dispatch/middleware/stack.rb:89:in insert': No such middleware to insert before: Non::Existent::Middleware (RuntimeError)

Reported by Nate Wiger · January 10th, 2010 @ 02:25 AM

State: resolved
Milestone: none
Assigned to: José Valim José Valim
Importance: Low