Filter Ordering in Edge Rails (Rev 7143)

Filter chaining appears to behave in differently than Rails 1.2.x. It
seems that I'm getting a lot of errors along the lines of:

ActionController::ActionControllerError: filter
#<ActionController::Filters::ClassMethods::BeforeFilterProxy:0x322f468
@filter=#<ActionController::Filters::ClassMethods::SymbolFilter:
0x322f4b8 @filter=:login_required>> was in the wrong place!

This isn't very helpful. How are you guys hunting down the problems
with your filter ordering?

James H.

Filter chaining appears to behave in differently than Rails 1.2.x. It
seems that I'm getting a lot of errors along the lines of:

ActionController::ActionControllerError: filter
#<ActionController::Filters::ClassMethods::BeforeFilterProxy:0x322f468
@filter=#<ActionController::Filters::ClassMethods::SymbolFilter:
0x322f4b8 @filter=:login_required>> was in the wrong place!

This isn't very helpful. How are you guys hunting down the problems
with your filter ordering?

With much gnashing of teeth to be honest. But I don't think what
you're seeing is a mistake on your part, but rather a bug in rails.

I've been seeing that bug with one of my applications, but have had no
luck reproducing it in the test cases for filters. I was planning on
spending some time this weekend isolating it in a smaller sample app,
but if you could help out with that I'd be very grateful.

Definitely. I'll try to whip something up test app soon.

James H.

James, nik.wakelin and I have submitted failing test cases that
exhibit this behaviour at http://dev.rubyonrails.org/ticket/8803

Regards,
kamal

A patch is here: http://dev.rubyonrails.org/ticket/8891

if that doesn’t fix your problem, I also found a different bug in the edge filter processing that occurs when one filter adds an additional filter while processing - a bug in update_filter_chain.

http://dev.rubyonrails.org/ticket/8383

-Andrew