| |
Melbourne Ruby User Group |
People,
I'm not sure if this is very widely known, but 4 months DHH changed
It is imperative that if you're using this method of filter chain
before_filter :stop_nasty_buggers
def stop_nasty_buggers
now becomes:
before_filter :stop_nasty_buggers
def stop_nasty_buggers
Returning false don't to jack no more. Note that redirecting and
There's no mention of this deprecation on the Rails website [3], no
Was this announced anywhere (besides the ActionPack CHANGELOG) or do I
Ryan.
P.S. if you were good boys and girls and had tests for your filters
[1] http://dev.rubyonrails.org/changeset/7984
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].
halting (and you've upgraded to Rails 2.0) that you update your code-
base ASAP, i.e.:
false
end
halt(404)
end
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.
mention of this API change in the official 'we iz got Rails 2.0 teh
r0x0r' post [4].
need my head checked for memory impairment?
(i.e. not like me), you'd have caught this in your builds.
[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