This project is archived and is in readonly mode.

#4761 ✓resolved
Jake Dempsey

Skip before filters do not merge when subclassing

Reported by Jake Dempsey | June 3rd, 2010 @ 04:39 PM | in 3.0.2

In the below scenario, we have a Core::FooController that defines some actions and also provides a skip before filter for one of his actions. Later we extend the Core::FooController and create the Enhanced::FooController and he has actions that are not part of the core but need to also skip the same before filter (such as login). When you try to access action_a through the Extended controller, the skip before filter is ignored. I would think that when the subclass provides a skip before filter it would merge in the parent classes definition as well. Otherwise you have to put the skip before filter defined in the core in every sublcass.

class ApplicationController
def method_a end end

class Core::FooController < ApplicationController
skip_before_filter :method_a, :only => [:action_a]

def action_a end end

class Enhanced::FooController < Core::FooController
skip_before_filter :method_a, :only => [:action_b]

def action_b end end

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages