Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source
Show
Ignore:
Timestamp:
04/04/08 20:26:42 (5 months ago)
Author:
josh
Message:

Replaced callback method evaluation in AssociationCollection class to use ActiveSupport::Callbacks. Modified ActiveSupport::Callbacks::Callback#call to accept multiple arguments.

Files:

Legend:

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

    r9080 r9225  
    386386      def call(controller, &block) 
    387387        if should_run_callback?(controller) 
    388           proc = filter_responds_to_before_and_after? ? around_proc : method 
    389           evaluate_method(proc, controller, &block) 
     388          method = filter_responds_to_before_and_after? ? around_proc : self.method 
     389 
     390          # For around_filter do |controller, action| 
     391          if method.is_a?(Proc) && method.arity == 2 
     392            evaluate_method(method, controller, block) 
     393          else 
     394            evaluate_method(method, controller, &block) 
     395          end 
    390396        else 
    391397          block.call