People,
I'm not sure if this is very widely known, but 4 months DHH changed
the API for ActionController's filters [1]. Since for ever you could
halt the filter chain by returning false. This was (and still is)
advice given in the official AWDWR book by the PragProgs [2].
It is imperative that if you're using this method of filter chain
halting (and you've upgraded to Rails 2.0) that you update your code-
base ASAP, i.e.:
before_filter :stop_nasty_buggers
def stop_nasty_buggers
false
end
now becomes:
before_filter :stop_nasty_buggers
def stop_nasty_buggers
halt(404)
end
Returning false don't to jack no more. Note that redirecting and
rendering in a filter method still halts execution. The current
documentation point this out (halt on redirect or render) but doesn't
mention the deprecation of returning false, which makes this somewhat
ambiguous in my opinion.
There's no mention of this deprecation on the Rails website [3], no
mention of this API change in the official 'we iz got Rails 2.0 teh
r0x0r' post [4].
Was this announced anywhere (besides the ActionPack CHANGELOG) or do I
need my head checked for memory impairment?
Ryan.
P.S. if you were good boys and girls and had tests for your filters
(i.e. not like me), you'd have caught this in your builds.
[1] http://dev.rubyonrails.org/changeset/7984
[2] http://pragprog.com/titles/rails2
[3] http://www.rubyonrails.org/deprecation
[4] http://weblog.rubyonrails.org/2007/12/7/rails-2-0-it-s-done