This project is archived and is in readonly mode.
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
-
Rohit Arondekar June 11th, 2010 @ 10:28 AM
- Assigned user set to José Valim
I think this is related to https://rails.lighthouseapp.com/projects/8994/tickets/3913
-
José Valim June 11th, 2010 @ 10:43 AM
- Milestone cleared.
- State changed from new to open
- Assigned user changed from José Valim to Yehuda Katz (wycats)
Planning to pair with Mr. Katz on it today and make it shine!
-
Piotr Sarnacki June 21st, 2010 @ 01:05 PM
Have you worked on it already?
I tried to reproduce it on edge and it seems to work perfectly.
-
Repository June 22nd, 2010 @ 06:58 AM
- State changed from open to resolved
(from [02399a1184d0f87b14af461fab731120d92c5ad8]) Ensure overwritten callbacks conditions in controllers work [#4761 state:resolved] [#3913 state:resolved] http://github.com/rails/rails/commit/02399a1184d0f87b14af461fab7311...
-
José Valim June 22nd, 2010 @ 01:39 PM
- Assigned user changed from Yehuda Katz (wycats) to José Valim
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>
People watching this ticket
Referenced by
- 4761 Skip before filters do not merge when subclassing (from [02399a1184d0f87b14af461fab731120d92c5ad8]) Ensure ...
- 3913 protect_from_forgery :except override in individual controllers isn't working in rails 3pre (from [02399a1184d0f87b14af461fab731120d92c5ad8]) Ensure ...