Here's a simple module that allows for execution of arbitrary code after the complete set of before_filters. With a little work, you could probably clean this up so that a queue of special after_before_filters
were executed here (with appopriate halting behavior, and so on).
module OneLastFilterModule
def self.included(base)
base.class_eval do
def perform_action_without_filters_with_one_last_filter
#
# do "final" before_filter work here
#
perform_action_without_filters_without_one_last_filter
end
alias_method_chain :perform_action_without_filters, :one_last_filter
end
end
end
Note that you should be careful about doing this, since controllers themselves may make assumptions about filter ordering based on declaration order.