This project is archived and is in readonly mode.

ActionController::Caching::Sweeping method_missing doesn't take a proc
Reported by Tys von Gaza | December 15th, 2008 @ 09:29 PM
If you want to run a controller action that requires a proc it won't get passed along through the sweepers method missing call.
IE, the following will get "no block":
class DevicesController < ApplicationController cache_sweeper :device_sweeper, :only => [ : mymethod ]
def mymethod(&block)
 if block_given?
   yield
 else
   "no block"
 end
end end
class DeviceSweeper < ActionController::Caching::Sweeper observe Device def after_create(device)
mymethod do |page|
  "doing stuff in my block"
end
end end
To fix this, a &block argument has to be added onto the the method missing in ActionController::Caching::Sweeping.
Comments and changes to this ticket
- 
            
         Tys von Gaza December 15th, 2008 @ 09:43 PM- Tag changed from 2.2, actioncontroller, bug, caching, sweeper to 2.2, actioncontroller, bug, caching, patch, sweeper
- Title changed from ActionController::Caching::Sweeping method_missing doesn't take a &block to ActionController::Caching::Sweeping method_missing doesn't take a proc
 Patch for the fix following the guide here: http://rails.lighthouseapp.com/p... Not really sure where to get started to add a test for this, advice? 
- 
         Jeremy Kemper December 15th, 2008 @ 11:04 PM- Milestone cleared.
- State changed from new to open
 
- 
         Repository January 27th, 2009 @ 10:13 PM(from [dd02af5c7e74b4ea0383b0df87824fb2b37f2243]) Fix for sweepers method_missing missing &block argument [#1581 status:committed] Signed-off-by: David Heinemeier Hansson david@loudthinking.com http://github.com/rails/rails/co... 
- 
         DHH January 27th, 2009 @ 10:14 PM- State changed from open to committed
 
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
- Nobody is watching this ticket.
Attachments
Referenced by
- 
         1581 
          ActionController::Caching::Sweeping method_missing doesn't take a proc
        (from [dd02af5c7e74b4ea0383b0df87824fb2b37f2243]) Fix for... 1581 
          ActionController::Caching::Sweeping method_missing doesn't take a proc
        (from [dd02af5c7e74b4ea0383b0df87824fb2b37f2243]) Fix for...