Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 1238

Show
Ignore:
Timestamp:
04/27/05 06:42:12 (3 years ago)
Author:
david
Message:

Added conditions to around_filters just like before_filter and after_filter

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/lib/action_controller/filters.rb

    r525 r1238  
    203203      #   B#after 
    204204      def append_around_filter(*filters) 
     205        conditions = extract_conditions!(filters)  
    205206        for filter in filters.flatten 
    206207          ensure_filter_responds_to_before_and_after(filter) 
    207           append_before_filter { |c| filter.before(c) } 
    208           prepend_after_filter { |c| filter.after(c) } 
     208          append_before_filter(conditions || {}) { |c| filter.before(c) } 
     209          prepend_after_filter(conditions || {}) { |c| filter.after(c) } 
    209210        end 
    210211      end