Side-effect before_filters in Rails

Piers is talking about the dangers of side-effect filters in Rails. That is, the unexpected behavior that can occur when a before filter that’s not conditional returns false.

The solution I’ve been using:

def i_am_a_before_filter
  returning(true) do
    # ... side-effect code
  end
end

About this entry