Ruby on Rails, before_filter and prepend_before_filter ordering is?
To my knowledge this is to solve class inheritance where you cannot define the order of the before_filter:
ApplicationController < ActionController::Base before_filter :do_this_first #....endSomeController < ApplicationController before_filter :do_this_second #.... end
Here, neither of the methods defined will have preference unless you use a prepend_before_filter.
Looks like prepend_filter
, in a queue of before_filter
s, it adds a filter in front of the queue. Hence, last come, first served.