Class: ActionController::Filters::FilterChain

Inherits:
ActiveSupport::Callbacks::CallbackChain
  • Object
show all
Defined in:
lib/action_controller/filters.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#append_filter_to_chain(filters, filter_type, &block) ⇒ Object



11
12
13
14
# File 'lib/action_controller/filters.rb', line 11

def append_filter_to_chain(filters, filter_type, &block)
  pos = find_filter_append_position(filters, filter_type)
  update_filter_chain(filters, filter_type, pos, &block)
end

#create_filters(filters, filter_type, &block) ⇒ Object



21
22
23
24
25
# File 'lib/action_controller/filters.rb', line 21

def create_filters(filters, filter_type, &block)
  filters, conditions = extract_options(filters, &block)
  filters.map! { |filter| find_or_create_filter(filter, filter_type, conditions) }
  filters
end

#prepend_filter_to_chain(filters, filter_type, &block) ⇒ Object



16
17
18
19
# File 'lib/action_controller/filters.rb', line 16

def prepend_filter_to_chain(filters, filter_type, &block)
  pos = find_filter_prepend_position(filters, filter_type)
  update_filter_chain(filters, filter_type, pos, &block)
end

#skip_filter_in_chain(*filters, &test) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/action_controller/filters.rb', line 27

def skip_filter_in_chain(*filters, &test)
  filters, conditions = extract_options(filters)
  filters.each do |filter|
    if callback = find(filter) then delete(callback) end
  end if conditions.empty?
  update_filter_in_chain(filters, :skip => conditions, &test)
end