Execute conditional procs on controller filters only for current action

Starting with Rails 4, and present in 4-0-stable and master, action callbacks like before_filter always execute the method/proc passed to :if. This was not the case in Rails 3.x.

Aside from the obvious performance issue, this regression is problematic because apps may expect certain url params be present in one action, that will be used in the :if proc. If another action is also executing the proc, those url params may not be present, causing the app to explode.

I've created a new rails 4 app to demonstrate the issue. https://github.com/njakobsen/filter_bug

I've fixed the problem by adding :only and :except options for controller filters before :if and :unless, instead of after. This prevents running :if and :unless procs when not on the specified action.